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: the calculated columns explicit type convert into date #14813

Merged
merged 1 commit into from
May 26, 2021

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented May 25, 2021

SUMMARY

datetime column(grain columns) get default column type when this column lack of column type.

This situation occurs in the calculated columns.

related issue: #13702

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

make a calculated columns and selected is temporal checkbox

image

make calculated columns as time columns and do query.

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: fixes Time filtering - Not working on calculated fields #13702
  • 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 25, 2021

Codecov Report

Merging #14813 (0ed714e) into master (9a96dac) will decrease coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14813      +/-   ##
==========================================
- Coverage   77.63%   77.39%   -0.24%     
==========================================
  Files         962      962              
  Lines       49156    49157       +1     
  Branches     6183     6183              
==========================================
- Hits        38161    38047     -114     
- Misses      10792    10907     +115     
  Partials      203      203              
Flag Coverage Δ
hive ?
mysql 81.63% <100.00%> (+<0.01%) ⬆️
postgres 81.65% <100.00%> (+<0.01%) ⬆️
presto ?
python 81.73% <100.00%> (-0.44%) ⬇️
sqlite 81.27% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/connectors/sqla/models.py 88.09% <100.00%> (-1.66%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 70.32% <0.00%> (-17.08%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.53%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/base.py 87.90% <0.00%> (-0.41%) ⬇️
superset/models/core.py 89.70% <0.00%> (-0.27%) ⬇️
superset/utils/core.py 88.91% <0.00%> (-0.13%) ⬇️

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 9a96dac...0ed714e. Read the comment docs.

@junlincc junlincc added the bash! label May 25, 2021
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

As a workaround, I think this is a good default for now. However, in the long term it would be great if we could make it possible to sync the calculated column types, similar to how it's possible to sync the regular columns. This shouldn't be difficult to do - just trigger a query with a LIMIT of 1 and pick up the datatypes that come back from the database. However, let's leave that for a follow-up task.

@zhaoyongjie zhaoyongjie merged commit 6bdbd2b into apache:master May 26, 2021
john-bodley added a commit that referenced this pull request Oct 4, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 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 size/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants