Skip to content

Commit

Permalink
add log for values unseen
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed May 3, 2023
1 parent ad19cd9 commit 3bbb7c4
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ def upgrade():
session = db.Session(bind=bind)

with op.batch_alter_table("slices") as batch_op:
for slc in session.query(Slice).filter(Slice.datasource_type == "query").all():
upgrade_slc(slc)
session.add(slc)
for slc in session.query(Slice).filter(Slice.datasource_type != "table").all():
if slc.datasource_type == "query":
upgrade_slc(slc)
session.add(slc)

else:
print(
f"unknown value detected for slc.datasource_type: {slc.datasource_type}"
)

batch_op.create_check_constraint(
"ck_chart_datasource", "datasource_type in ('table')"
Expand Down

0 comments on commit 3bbb7c4

Please sign in to comment.