Skip to content

Commit

Permalink
Update superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_cha…
Browse files Browse the repository at this point in the history
…rt_ds_constraint.py

Co-authored-by: Elizabeth Thompson <[email protected]>
  • Loading branch information
hughhhh and eschutho committed May 3, 2023
1 parent 1c02d9c commit 3c7509f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def upgrade_slc(slc: Slice) -> None:
try:
params_dict = json.loads(slc.params)
ds_id, ds_type = params_dict["datasource"].split("__")
# the assumption here is that the query was saved as a dataset
# but the type wasn't written properly to the slice
# by updating the type here we expect it will either work
# or it will 404 when the dataset is looked up.
params_dict["datasource"] = f"{ds_id}__table"
slc.params = json.dumps(params_dict)
except Exception:
Expand Down

0 comments on commit 3c7509f

Please sign in to comment.