Skip to content

Conversation

@villebro
Copy link
Member

@villebro villebro commented Oct 26, 2020

SUMMARY

TableColumn has three properties to check the datatype of a column: is_numeric, is_string and is_temporal. is_temporal is usually referenced when a new dataset is added to populate default values for is_dttm, which indicates whether or not a column is to added to the time column dropdown. While we should usually directly reference is_dttm, the other slightly ambiguously named property can sometimes be used, causing incorrect behaviour.

This PR changes the behaviour of is_temporal to first check the value of is_dttm, and if that is not None (=after initial metadata extraction), return that value, otherwise check the datatype based on the column type. The placeholder text is also fixed, as it featured non-compliant syntax (Year is %Y, not %y).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Added test.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@villebro villebro force-pushed the villebro/is-temporal branch from bff1a24 to 578f9a6 Compare October 26, 2020 19:04
@codecov-io
Copy link

codecov-io commented Oct 26, 2020

Codecov Report

Merging #11429 into master will decrease coverage by 4.64%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11429      +/-   ##
==========================================
- Coverage   66.55%   61.90%   -4.65%     
==========================================
  Files         860      861       +1     
  Lines       40866    40920      +54     
  Branches     3694     3694              
==========================================
- Hits        27198    25332    -1866     
- Misses      13570    15408    +1838     
- Partials       98      180      +82     
Flag Coverage Δ
#cypress ?
#javascript 62.90% <ø> (-0.05%) ⬇️
#python 61.32% <100.00%> (-0.61%) ⬇️

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

Impacted Files Coverage Δ
...erset-frontend/src/datasource/DatasourceEditor.jsx 63.63% <ø> (-7.73%) ⬇️
superset/connectors/sqla/models.py 89.51% <100.00%> (-0.25%) ⬇️
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupColors.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/chart/ChartContainer.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupFormatters.js 0.00% <0.00%> (-100.00%) ⬇️
... and 193 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 ac498dd...578f9a6. Read the comment docs.

@villebro villebro requested a review from dpgaspar October 26, 2020 22:17
Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

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

makes sense

@villebro villebro merged commit 8575439 into apache:master Oct 27, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 First shipped in 1.0.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/S 🚢 1.0.0 First shipped in 1.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants