From aa3a02d1f9d65909ebd5bca5fe21906f2886c6d4 Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Tue, 2 Aug 2022 15:49:32 -0700 Subject: [PATCH] skip row if created_at_fk is null (#20939) (cherry picked from commit fb5f8cacaf797b26c64d3151c293a8e6c934ad97) --- ...5_15-48_409c7b420ab0_add_created_by_fk_as_owner.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/superset/migrations/versions/2022-07-05_15-48_409c7b420ab0_add_created_by_fk_as_owner.py b/superset/migrations/versions/2022-07-05_15-48_409c7b420ab0_add_created_by_fk_as_owner.py index 8992af1b57098..6cdf9f6891cbd 100644 --- a/superset/migrations/versions/2022-07-05_15-48_409c7b420ab0_add_created_by_fk_as_owner.py +++ b/superset/migrations/versions/2022-07-05_15-48_409c7b420ab0_add_created_by_fk_as_owner.py @@ -22,16 +22,17 @@ """ -# revision identifiers, used by Alembic. -revision = "409c7b420ab0" -down_revision = "a39867932713" - from alembic import op from sqlalchemy import and_, Column, insert, Integer from sqlalchemy.ext.declarative import declarative_base +# revision identifiers, used by Alembic. from superset import db +revision = "409c7b420ab0" +down_revision = "a39867932713" + + Base = declarative_base() @@ -95,7 +96,7 @@ def upgrade(): DatasetUser.user_id == Dataset.created_by_fk, ), ) - .filter(DatasetUser.dataset_id == None), + .filter(DatasetUser.dataset_id == None, Dataset.created_by_fk != None), ) )