You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/03/31 18:56:00 UTC
[GitHub] [superset] serenajiang opened a new pull request #19474: fix: handle null params in #18936 migration
serenajiang opened a new pull request #19474:
URL: https://github.com/apache/superset/pull/19474
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
This migration failed in our env because we have a few slices with null params. The UI/API should have prevented this from happening so I don't know how this happened, but as the params column is nullable in the db, we should handle nulls.
### TESTING INSTRUCTIONS
Tested upgrade
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] serenajiang merged pull request #19474: fix: handle null params in #18936 migration
Posted by GitBox <gi...@apache.org>.
serenajiang merged pull request #19474:
URL: https://github.com/apache/superset/pull/19474
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] john-bodley commented on a change in pull request #19474: fix: handle null params in #18936 migration
Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #19474:
URL: https://github.com/apache/superset/pull/19474#discussion_r839932794
##########
File path: superset/migrations/versions/ab9a9d86e695_deprecate_time_range_endpoints.py
##########
@@ -47,7 +47,7 @@ def upgrade():
session = db.Session(bind=bind)
for slc in session.query(Slice):
- params = json.loads(slc.params)
+ params = json.loads(slc.params or "{}")
Review comment:
@serenajiang if the params are borked we'll clear them all out on line #52. I think a try/except is preferred.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] john-bodley commented on a change in pull request #19474: fix: handle null params in #18936 migration
Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #19474:
URL: https://github.com/apache/superset/pull/19474#discussion_r839932794
##########
File path: superset/migrations/versions/ab9a9d86e695_deprecate_time_range_endpoints.py
##########
@@ -47,7 +47,7 @@ def upgrade():
session = db.Session(bind=bind)
for slc in session.query(Slice):
- params = json.loads(slc.params)
+ params = json.loads(slc.params or "{}")
Review comment:
@serenajiang if the params are borked we'll clear them all out on line #52. I think a try/except is preferred, i.e., best to leave borked params in an unchanged state. A future migration should clean this up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org