-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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: apply Time Grain to X-Axis column #21163
feat: apply Time Grain to X-Axis column #21163
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21163 +/- ##
==========================================
- Coverage 66.45% 66.42% -0.03%
==========================================
Files 1789 1789
Lines 68291 68322 +31
Branches 7273 7273
==========================================
+ Hits 45382 45384 +2
- Misses 21034 21063 +29
Partials 1875 1875
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c60709b
to
e99d853
Compare
9188b3b
to
f1c8e04
Compare
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.
Pretty cool stuff on the way here..! 👏 Left a few comments. Also, it's slightly difficult to give a good review in the absence of having seen designs or frontend POC code, so if there's anything like that out there I'd love to see it to get a more complete understanding of how this is meant to work eventually.
@villebro Thanks for the review! I will add a frontend part this week for convenience to review. |
f1c8e04
to
ce712c5
Compare
33167b1
to
f8ebcfb
Compare
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.
Thank you for PR @zhaoyongjie. I left some suggestions.
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/query/normalizeTimeColumn.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/query/normalizeTimeColumn.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/query/normalizeTimeColumn.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/test/query/buildQueryContext.test.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/test/query/normalizeTimeColumn.test.ts
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/test/query/normalizeTimeColumn.test.ts
Outdated
Show resolved
Hide resolved
@michael-s-molina Thanks for the review, I have addressed your comments. |
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.
Tested to work with the FF enabled and disabled with both legacy and new Timeseries charts. A few minor nits, but apart from that LGTM and hoping to see this merged soon! Also, we may want to consider adding a line in UPDATING.md
to state that with the feature flag enabled, the time grain control will move below the x-axis control.
superset-frontend/packages/superset-ui-core/src/query/normalizeTimeColumn.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-core/src/query/types/Column.ts
Outdated
Show resolved
Hide resolved
superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx
Outdated
Show resolved
Hide resolved
c6882be
to
ec873f2
Compare
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.
LGTM. Thanks for addressing the suggestions @zhaoyongjie. I agree with @villebro about adding something to UPDATING.md
before merging this PR. Another suggestion would be to get approval from @jinghua-qa as well. Awesome work @zhaoyongjie!
/testenv up FEATURE_GENERIC_CHART_AXES=true FEATURE_DRILL_TO_DETAIL=true FEATURE_DASHBOARD_CROSS_FILTERS=true |
@zhaoyongjie Ephemeral environment spinning up at http://35.91.72.50:8080. Credentials are |
Tested in ephemeral env, and the new feature LGTM. However i have found 2 issues that also in master branch, i will file tickets to follow up. Screen.Recording.2022-09-07.at.1.07.16.AM.mov2, when db=sqlite, and use custom sql in x-axis, time grain did not apply Screen.Recording.2022-09-07.at.1.11.07.AM.mov |
@jinghua-qa Thanks for testing, I'm gonna follow up in a separate PR. |
Ephemeral environment shutdown and build artifacts deleted. |
This reverts commit ce3d38d.
@@ -27,6 +27,8 @@ assists people when migrating to a new version. | |||
- [20606](https://github.com/apache/superset/pull/20606): When user clicks on chart title or "Edit chart" button in Dashboard page, Explore opens in the same tab. Clicking while holding cmd/ctrl opens Explore in a new tab. To bring back the old behaviour (always opening Explore in a new tab), flip feature flag `DASHBOARD_EDIT_CHART_IN_NEW_TAB` to `True`. | |||
- [20799](https://github.com/apache/superset/pull/20799): Presto and Trino engine will now display tracking URL for running queries in SQL Lab. If for some reason you don't want to show the tracking URL (for example, when your data warehouse hasn't enable access for to Presto or Trino UI), update `TRACKING_URL_TRANSFORMER` in `config.py` to return `None`. | |||
- [21002](https://github.com/apache/superset/pull/21002): Support Python 3.10 and bump pandas 1.4 and pyarrow 6. | |||
- [21163](https://github.com/apache/superset/pull/21163): When `GENERIC_CHART_AXES` feature flags set to `True`, the Time Grain control will move below the X-Axis control. |
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.
@zhaoyongjie would you mind expanding on this bullet point? From reading through the PR description et al. it seems that the biggest change is that the time grain is now decoupled from the time filter column. As it currently reads now "... will move below the X-Axis control." it sounds like it's purely a cosmetic change as opposed to a scoping change.
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.
@john-bodley update the document at PR
SUMMARY
Currently, the
Time Grain
control defines a couple ofdate truncate functions
on theTime Column
.Time Grain
only be applied if theTime column
andX-Axis
are set to the same value. This PR is the first step to removing the entire time section.After this PR, when enabling the
GENERIC_CHART_AXES
Time Grain Control
removes fromTime Section
.Time Grain Control
will show if i) applies a Date Column in theX-Axis
. ii) applies a Adhoc ColumnTime Grain Control
will be displayed underX-Axis
.This change allows Time Column and Time Filter to use different columns, Time Series Chart will support different column to set
Time Filter
andX-Axis
, andTime Grain
will be applied to theX-Axis
.Supported Charts
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
SQL Pattern
Apply
Categorical Column
orDate Column
to theX-Axis
Apply.Time.Grain.to.X-Axis.mov
Custom SQL
Custom.SQL.mov
TESTING INSTRUCTIONS
In order to test this PR, the multiple Date column should provide, so I prepare a CSV (superstore_orders.csv) file for that. Just load this CSV to test this PR.
ADDITIONAL INFORMATION
GENERIC_CHART_AXES