betodealmeida commented on code in PR #39977:
URL: https://github.com/apache/superset/pull/39977#discussion_r3319090954
##########
superset/commands/importers/v1/utils.py:
##########
@@ -400,3 +401,51 @@ 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) -> Any | None:
+ """Look up an existing row by UUID for an import operation,
+ bypassing the soft-delete visibility filter so soft-deleted matches
+ are returned too.
Review Comment:
Nit, by [convention](https://peps.python.org/pep-0257/) docstrings should
have a 1-line short description. Because it's a convention a lot of tooling
will rely on it, and in this case IDEs and other tools would show only "Look up
an existing row by UUID for an import operation," as the documentation for the
function.
--
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]