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

fix(presto,trino): use correct literal dttm separator #20123

Merged
merged 2 commits into from
May 19, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented May 19, 2022

SUMMARY

#19917 migrated the convert_dttm functions in the Presto and Trino db engine specs to use the currently recommended literal timestamp type cast over the now deprecated from_iso8601_* functions. However, the new literal casts require the separator to be a blank space instead of the "T" separator:

This PR updates the format to correspond with the supported format and updates the unit tests accordingly. In addition, the convert_dttm tests are removed from the legacy integration test suite, as they're already covered by the new unit tests.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #20123 (da7ee65) into master (1fe30f1) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #20123      +/-   ##
==========================================
- Coverage   66.46%   66.44%   -0.03%     
==========================================
  Files        1721     1721              
  Lines       64467    64477      +10     
  Branches     6795     6795              
==========================================
- Hits        42847    42839       -8     
- Misses      19892    19910      +18     
  Partials     1728     1728              
Flag Coverage Δ
hive 53.70% <0.00%> (+0.01%) ⬆️
mysql 82.14% <100.00%> (+<0.01%) ⬆️
postgres ?
presto 53.56% <0.00%> (+0.01%) ⬆️
python 82.56% <100.00%> (-0.06%) ⬇️
sqlite 81.94% <100.00%> (+<0.01%) ⬆️
unit 49.40% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engine_specs/presto.py 88.70% <100.00%> (ø)
superset/db_engine_specs/trino.py 71.42% <100.00%> (ø)
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/sql_validators/__init__.py 80.00% <0.00%> (-20.00%) ⬇️
superset/reports/commands/log_prune.py 85.71% <0.00%> (-3.58%) ⬇️
superset/databases/commands/validate_sql.py 92.00% <0.00%> (-2.00%) ⬇️
superset/db_engine_specs/postgres.py 95.45% <0.00%> (-1.82%) ⬇️
superset/commands/importers/v1/utils.py 92.20% <0.00%> (-1.30%) ⬇️
superset/common/query_object.py 94.73% <0.00%> (-0.53%) ⬇️
superset/views/base_api.py 97.97% <0.00%> (-0.41%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fe30f1...da7ee65. Read the comment docs.

@pull-request-size pull-request-size bot added size/M and removed size/S labels May 19, 2022
Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though wondering if the same also applies to athena?

@villebro
Copy link
Member Author

LGTM, though wondering if the same also applies to athena?

Good point, let me check and add Athena, too.

@villebro
Copy link
Member Author

Turns out Athena was already using the space separator, so going to go ahead and merge this.

@villebro villebro merged commit e2f11d3 into apache:master May 19, 2022
@villebro villebro deleted the villebro/trino-literal-dttm branch May 19, 2022 17:42
villebro added a commit that referenced this pull request May 26, 2022
* fix(presto,trino): use correct literal dttm separator

* remove redundant tests

(cherry picked from commit e2f11d3)
michael-s-molina pushed a commit that referenced this pull request May 26, 2022
* fix(presto,trino): use correct literal dttm separator

* remove redundant tests

(cherry picked from commit e2f11d3)
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* fix(presto,trino): use correct literal dttm separator

* remove redundant tests
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Jun 16, 2022
* fix(presto,trino): use correct literal dttm separator

* remove redundant tests

(cherry picked from commit e2f11d3)
@mistercrunch mistercrunch added 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels lts-v1 preset-io size/M 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants