eschutho commented on code in PR #23925:
URL: https://github.com/apache/superset/pull/23925#discussion_r1184324986
##########
superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py:
##########
@@ -48,13 +51,16 @@ class Slice(Base): # type: ignore
def upgrade_slc(slc: Slice) -> None:
# clean up all charts with datasource_type not != table
slc.datasource_type = "table"
+ ds_id = None
+ ds_type = None
try:
params_dict = json.loads(slc.params)
ds_id, ds_type = params_dict["datasource"].split("__")
params_dict["datasource"] = f"{ds_id}__table"
slc.params = json.dumps(params_dict)
Review Comment:
```suggestion
slc.params = json.dumps(params_dict)
logger.warning("updated slice datasource_type from %s__%s to table",
ds_id, ds_type)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]