From 18580aad1e2994be613bf9ec07455c4ba3acbde1 Mon Sep 17 00:00:00 2001 From: AAfghahi <48933336+AAfghahi@users.noreply.github.com> Date: Thu, 8 Apr 2021 10:54:48 -0400 Subject: [PATCH] Update superset/queries/saved_queries/commands/importers/v1/utils.py Co-authored-by: Hugh A. Miles II --- .../queries/saved_queries/commands/importers/v1/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superset/queries/saved_queries/commands/importers/v1/utils.py b/superset/queries/saved_queries/commands/importers/v1/utils.py index f2d090bf11e5b..3618b289110af 100644 --- a/superset/queries/saved_queries/commands/importers/v1/utils.py +++ b/superset/queries/saved_queries/commands/importers/v1/utils.py @@ -26,10 +26,9 @@ def import_saved_query( session: Session, config: Dict[str, Any], overwrite: bool = False ) -> SavedQuery: existing = session.query(SavedQuery).filter_by(uuid=config["uuid"]).first() - if existing: - if not overwrite: + if existing and not overwrite: return existing - config["id"] = existing.id + config["id"] = existing.id saved_query = SavedQuery.import_from_dict(session, config, recursive=False) if saved_query.id is None: