-
Notifications
You must be signed in to change notification settings - Fork 14.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
[migration] Fix migration 3dda56f1c #5471
[migration] Fix migration 3dda56f1c #5471
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5471 +/- ##
=======================================
Coverage 59.11% 59.11%
=======================================
Files 372 372
Lines 23751 23751
Branches 2758 2758
=======================================
Hits 14041 14041
Misses 9695 9695
Partials 15 15 Continue to review full report at Codecov.
|
@john-bodley, if I understand correctly you're removing |
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, I think the db_engine_specs_map
is wrong.
'week_start_monday': 'P1W', | ||
'week_starting_sunday': 'P1W', | ||
'P1W/1970-01-03T00:00:00Z': 'P1W', | ||
'1969-12-28T00:00:00Z/P1W': 'P1W', |
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.
This should be the opposite, since it maps the old format to the new one:
'week_ending_saturday': 'P1W/1970-01-03T00:00:00Z',
'week_start_sunday': '1969-12-28T00:00:00Z/P1W',
'week_start_monday': '1969-12-29T00:00:00Z/P1W',
'week_starting_sunday': '1969-12-28T00:00:00Z/P1W',
@betodealmeida the |
a4d2a1b
to
ae5ad56
Compare
(cherry picked from commit bfcc3a6)
This PR fixes a number of issues with the 3dda56f1c migration which we experienced whilst trying to upgrade our production database. Part of the issues are due to the lack of validation/sanitizing in the form-data and thus erroneous fields may be present.
Specifically this PR:
week_start_
andweek_starting_
. Ideally there should only beweek_starting_
which is consistent withweek_ending_
.granularity
(Druid) andtime_grain_sqla
(SQLA) defined (possibly due to switching of datasources). Rather than using the first truthy value it uses the the appropriate field associated with the datasource type.period_ratio_type
field could beNone
and thusparams.get('period_ratio_type', 'growth')
would returnNone
which would result in an exception when trying to calllower()
. The fix is simplyparams.get('period_ratio_type') or 'growth'
to ensure thatgrowth
is the fallback value.to: @betodealmeida @graceguo-supercat @mistercrunch @Michelle-Thomas @timifasubaa @williaster