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

Time series query broken #27798

Open
3 tasks done
jzhao62 opened this issue Apr 1, 2024 · 3 comments
Open
3 tasks done

Time series query broken #27798

jzhao62 opened this issue Apr 1, 2024 · 3 comments

Comments

@jzhao62
Copy link

jzhao62 commented Apr 1, 2024

Bug description

  • the query used to generate time series data some times needs be explicitly casted as timestamp, in order to be used in Postgres

How to reproduce the bug

  1. dump attached data to a a connected Postgres
  2. mark the timestamp as Temporal data
  3. create any time based chart and examine the auto generated sql
    time-series-data.csv

Screenshots/recordings

Screenshot_20240331_233316
Screenshot_20240331_233212
Screenshot_20240331_233241

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@zhaoyongjie
Copy link
Member

zhaoyongjie commented Apr 1, 2024

Hey @jzhao62, there is no column typing convert logic in current time grain expression so the TIMESTAMP column should have to be offered. The quick and dirty workaround that is to create a computed column in Superset dataset and apply the computed column as time column for your use case.

@jzhao62
Copy link
Author

jzhao62 commented Apr 1, 2024

hey @zhaoyongjie thanks, i dont know if this situation applies to all time series data or not. If we explicilty cast the timestamp when generating sql on UI, would it be a problem ?

@zhaoyongjie
Copy link
Member

@jzhao62 I totally agree with you. Ideally, the explicit typing conversion should be applied on the temporal column if explicitly defined a column as datetime/date/timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants