Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Older Dates with Year 1937 or less in charts is showing as NAN. #24561

Closed
dishant1691 opened this issue Jun 30, 2023 · 7 comments
Closed

Older Dates with Year 1937 or less in charts is showing as NAN. #24561

dishant1691 opened this issue Jun 30, 2023 · 7 comments
Labels
validation:validated A committer has validated / submitted the issue or it was reported by multiple users

Comments

@dishant1691
Copy link

dishant1691 commented Jun 30, 2023

Hello, I am using superset version 2.1.0

For older dates around year 1937 and back I am not able to see correct dates in charts, it is showing as NAN.
Although in dataset it is being shown correctly.

Database I have used Databricks SQL, SQL server.

For example I have created a simple table chart by using this dummy date in dataset:

select (current_date() - 31150 ) as dt1, the chart shows NAN value

image

But if I run this select (current_date() - 31105) as dt1, it shows correct date
image

So dates value 31150 days back from current date is not being shown correctly. But 31105 days back is correctly shown.
Can you please let me know if there is such limitation in charts and if it is so how can we rectify as we have dates older than 1930 year in our tables

@dishant1691 dishant1691 changed the title Older Dates in charts is showing as NAN. Older Dates with Year 1937 or less in charts is showing as NAN. Jun 30, 2023
@sfirke
Copy link
Member

sfirke commented Jun 30, 2023

What do you get when you run the same SQL query directly against the database, without Superset?

@dishant1691
Copy link
Author

I am getting exact date
image

but when trying to show them in Charts it shows NAN

@dishant1691
Copy link
Author

@sfirke Can you please check if this issue is version specific in charts.

@sfirke
Copy link
Member

sfirke commented Jul 3, 2023

I can replicate this bug with SQL Server and Superset 2.1.0.

  1. Run this query in SQL Lab and save as a data set:
select (GETDATE() - 31150 ) as dt1,
(GETDATE() - 31100 ) as dt2
  1. In the resulting chart creation view, the first date appears as NaN:

image

I don't know what's happening here.

@dishant1691
Copy link
Author

@sfirke
Do you know someone from Superset who can help me on this as this seems to be an issue with Superset charts.

@sfirke
Copy link
Member

sfirke commented Jul 5, 2023

I agree it seems like a bug in Superset. There's not really anyone "from Superset" because it's an open-source project without a single owner. Anyone could submit a pull request to fix this. I don't think it will be a priority for most developers because it doesn't affect anyone who isn't using old year values.

If you're able to poke around in the Superset code to figure this out, that would be ideal. Otherwise one thing you might be able to do is try testing this on different versions of Superset. If it's fixed in the new 3.0.0rc1, great. If nothing else, try other date values and see if you can learn anything. Does 1838 work? Is there a max date that returns this same NaN?

I thought it could be related to Pandas dates out of bounds, but 1938 seems too modern for that: https://pandas.pydata.org/docs/user_guide/timeseries.html#timestamp-limitations

@sfirke sfirke added the validation:validated A committer has validated / submitted the issue or it was reported by multiple users label Aug 11, 2023
@sfirke
Copy link
Member

sfirke commented Aug 11, 2023

I just tested this on 3.0.0rc2 and it appears fixed there. Following my steps above I get:
image

Maybe it was fixed by #23339 ? h/t to @justinpark for making the connection. At any rate, I'm going to close this issue. Please feel free to re-open or reply if this occurs again in 3.0.0 or latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validation:validated A committer has validated / submitted the issue or it was reported by multiple users
Projects
None yet
2 participants