This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7a75f0a2bc Protect against None components of universal pathlib xcom 
backend (#41921)
7a75f0a2bc is described below

commit 7a75f0a2bc6f964a943db98946ce652c43942180
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Sep 1 22:18:13 2024 +0200

    Protect against None components of universal pathlib xcom backend (#41921)
    
    fixes: #41723
---
 airflow/io/path.py                          | 2 +-
 airflow/providers/common/io/xcom/backend.py | 7 ++++++-
 hatch_build.py                              | 4 +---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/airflow/io/path.py b/airflow/io/path.py
index c6d9255f91..6deafae004 100644
--- a/airflow/io/path.py
+++ b/airflow/io/path.py
@@ -198,7 +198,7 @@ class ObjectStoragePath(CloudPath):
 
         Returns the new Path instance pointing to the target path.
         """
-        return self.rename(target, overwrite=True)
+        return self.rename(target)
 
     @classmethod
     def cwd(cls):
diff --git a/airflow/providers/common/io/xcom/backend.py 
b/airflow/providers/common/io/xcom/backend.py
index de64522fb2..af55baa4c0 100644
--- a/airflow/providers/common/io/xcom/backend.py
+++ b/airflow/providers/common/io/xcom/backend.py
@@ -142,7 +142,12 @@ class XComObjectStorageBackend(BaseXCom):
 
         base_path = _get_base_path()
         while True:  # Safeguard against collisions.
-            p = base_path.joinpath(dag_id, run_id, task_id, 
f"{uuid.uuid4()}{suffix}")
+            p = base_path.joinpath(
+                dag_id or "NO_DAG_ID",
+                run_id or "NO_RUN_ID",
+                task_id or "NO_TASK_ID",
+                f"{uuid.uuid4()}{suffix}",
+            )
             if not p.exists():
                 break
         p.parent.mkdir(parents=True, exist_ok=True)
diff --git a/hatch_build.py b/hatch_build.py
index 08f47731f2..4e17e1a8ec 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -494,9 +494,7 @@ DEPENDENCIES = [
     # See https://github.com/apache/airflow/pull/31693
     # We should also remove "3rd-party-licenses/LICENSE-unicodecsv.txt" file 
when we remove this dependency
     "unicodecsv>=0.14.1",
-    # The Universal Pathlib provides  Pathlib-like interface for FSSPEC
-    # https://github.com/apache/airflow/issues/41723  describes the issue
-    "universal-pathlib==0.2.2",  # Temporarily pin to 0.2.2 as 0.2.3 generates 
mypy errors
+    "universal-pathlib>=0.2.3",
     # Werkzug 3 breaks Flask-Login 0.6.2, also connexion needs to be updated 
to >= 3.0
     # we should remove this limitation when FAB supports Flask 2.3 and we 
migrate connexion to 3+
     "werkzeug>=2.0,<3",

Reply via email to