-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Pass granularity from backend to frontend as ISO duration #4755
Pass granularity from backend to frontend as ISO duration #4755
Conversation
…TOOLS-392_granularity_payload
Codecov Report
@@ Coverage Diff @@
## master #4755 +/- ##
==========================================
- Coverage 72.38% 72.33% -0.05%
==========================================
Files 205 205
Lines 15374 15394 +20
Branches 1182 1182
==========================================
+ Hits 11128 11136 +8
- Misses 4243 4255 +12
Partials 3 3
Continue to review full report at Codecov.
|
]), | ||
choices: [ | ||
[null, 'all'], | ||
['PT5S', '5 seconds'], |
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.
If a chart has been saved with a string say 5 seconds
as a value, did you confirm that this load up ok in here as a "free form" value? From my understanding it should.
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.
@betodealmeida ^ please confirm and I'll merge
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.
I exported a postgres backed set of charts and dashboards to another postgres instance with this change included. It seems to work when viewing the actual chart, but when a time grain is persisted on a chart used in a dashboard I'm getting an error as such:
I was able to backfill values stored on slices.params.time_grain_sqla, to the ISO durations from here and this resolved the issue. Did I miss a migration someplace or should one be added for this? |
@nathanQuinn ~~i think the ".function" part should be removed~~~. It's the default of the get that is wrong, it shouldn't be a string but a Grain. And we are probably missing some tests :) |
* Add ISO duration to time grains * Use ISO duration * Remove debugging code * Add module to yarn.lock * Remove autolint * Druid granularity as ISO * Remove dangling comma
* Add ISO duration to time grains * Use ISO duration * Remove debugging code * Add module to yarn.lock * Remove autolint * Druid granularity as ISO * Remove dangling comma
@betodealmeida should there be a DB migration associated with this PR to update slices which reference the deprecated time grains? cc: @michellethomas |
* Add ISO duration to time grains * Use ISO duration * Remove debugging code * Add module to yarn.lock * Remove autolint * Druid granularity as ISO * Remove dangling comma
Currently the backend will pass the granularity as a string that is engine dependent, e.g, "30 seconds". I changed the backend so that an ISO 8601 duration is passed instead. This allows the frontend to handle the granularity better, eg, for the play slider.