-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat(db_engine_specs): Allow uploaded columns of dtype datetime to be stored as TIMESTAMP in the Hive schema #21850
Conversation
… schema The views for uploading data files (csv, excel etc.) to a database have form options to pass and/or infer datetime columns. However, the hive `df_to_sql` method does not support storing datetime columns as TIMESTAMPs in the Hive schema. It would be a nice for the `_get_hive_type` functionality to at least support the basic `datetime64[ns]` dtype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!
Thanks @GerbenvdHuizen for the PR. Would you mind formalizing your testing strategy as either a unit or integration test? |
@john-bodley Added an integration test for all the schema definition types, since there didn't seem to be any yet. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #21850 +/- ##
==========================================
- Coverage 66.18% 65.96% -0.22%
==========================================
Files 1805 1987 +182
Lines 69066 90890 +21824
Branches 7369 7369
==========================================
+ Hits 45712 59959 +14247
- Misses 21448 29025 +7577
Partials 1906 1906
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
SUMMARY
The views for uploading data files (csv, excel etc.) to a database have form options to pass and/or infer
datetime
columns. However, the hivedf_to_sql
method does not support storingdatetime
columns as TIMESTAMPs in the Hive schema. It would be a nice for the_get_hive_type
functionality to at least support the basicdatetime64[ns]
dtype.TESTING INSTRUCTIONS
The following steps require you to be able to upload files to a schema on Superset (
allow_file_upload
) + use Hive as DB engine.Steps:
parse_dates
is set to the timestamp column in your csv file andinfer_datetime_format
is set to true within the form.ADDITIONAL INFORMATION