uranusjr commented on code in PR #70805:
URL: https://github.com/apache/airflow/pull/70805#discussion_r4141046840


##########
task-sdk/src/airflow/sdk/coordinators/_bundle_metadata.py:
##########
@@ -96,6 +103,25 @@ def _sorted_children(directory: pathlib.Path) -> 
list[pathlib.Path]:
         return []
 
 
+def convert_configured_roots(
+    value: _UnsetArtifactRoots
+    | None
+    | os.PathLike[str]
+    | pathlib.Path
+    | list[os.PathLike[str] | pathlib.Path],
+) -> list[pathlib.Path]:
+    """Normalize configured roots while rejecting explicitly empty values."""
+    if isinstance(value, _UnsetArtifactRoots):
+        return []
+    values = [value] if isinstance(value, (str, os.PathLike)) else (value or 
[])

Review Comment:
   This is a bit too much to me. I'd just use plain ifs
   
   ```python
   if isinstance(...):
       ...
   elif value:
       ...
   else:
       ...



-- 
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]

Reply via email to