mikebridge commented on code in PR #39977:
URL: https://github.com/apache/superset/pull/39977#discussion_r3210869355


##########
superset/commands/importers/v1/utils.py:
##########
@@ -400,3 +400,36 @@ def get_resource_mappings_batched(
         mapping.update({str(x.uuid): value_func(x) for x in batch})
         offset += batch_size
     return mapping
+
+
+def find_existing_for_import(model_cls: Type[Any], uuid: str) -> Optional[Any]:

Review Comment:
   We use the per-query opt-out 
(`execution_options(skip_visibility_filter=True)`) rather than the per-request 
flag (`flask.g.skip_visibility_filter`) so the bypass affects only this UUID 
lookup. The importer also queries referenced entities (datasets, owners, tags) 
while building the new row — those lookups must continue to respect the 
visibility filter, or a fresh chart could end up linked to a soft-deleted 
dataset. The per-query option is also the only one available outside a Flask 
request context (CLI / Celery imports), where `flask.g` doesn't exist. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to