Skip to content

Commit

Permalink
lets try this one
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed May 3, 2023
1 parent 087c818 commit 1c02d9c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,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)
except Exception:
# skip any malformatted params
logger.warning("failed to update slice: %s__%s", ds_id, ds_type)
pass


Expand All @@ -72,7 +75,7 @@ def upgrade():
session.add(slc)

else:
logger.info(
logger.warning(
"unknown value detected for slc.datasource_type: %s",
slc.datasource_type,
)
Expand Down

0 comments on commit 1c02d9c

Please sign in to comment.