-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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(explore): support saving undefined time grain #22565
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22565 +/- ##
=======================================
Coverage 66.91% 66.91%
=======================================
Files 1851 1851
Lines 70709 70709
Branches 7766 7766
=======================================
Hits 47316 47316
Misses 21371 21371
Partials 2022 2022
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 |
/testenv up FEATURE_GENERIC_CHART_AXES=true |
@zhaoyongjie Ephemeral environment spinning up at http://35.91.67.201:8080. Credentials are |
@@ -97,7 +97,6 @@ class TimeGrain(NamedTuple): | |||
|
|||
|
|||
builtin_time_grains: Dict[Optional[str], str] = { | |||
None: __("Original value"), |
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.
Thanks for getting rid of this option.
64196c9
to
b93d6e3
Compare
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Continuing the work from #21644, when saving a chart without a time grain, the chart reverts to the default time grain after the chart reloads in Explore view. To get around this, the user must choose the "Original value" option from the time grain dropdown. While this works, there should only be one way of clearing the time grain. A summary of changes introduced by this PR:
time_grain_sqla
entry is removed from the form data. To get around this, we check if the chart has been saved by looking at themetadata
property of the chart state - if it's defined, we know the chart has been saved, in which case we know that the time grain has been explicitly set toundefined
.The change has been tested to work in the following scenarios:
AFTER
With these changes, the time grain remains cleared even after saving:
grain-after.mp4
BEFORE
Previously, the chart would revert back to the default time grain
P1D
when the chart reloaded in Explore view:grain-before.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION