potiuk commented on code in PR #41921:
URL: https://github.com/apache/airflow/pull/41921#discussion_r1740174366
##########
airflow/providers/common/io/xcom/backend.py:
##########
@@ -142,7 +142,12 @@ def serialize_value(
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",
Review Comment:
I prefer to fix it this way - unless someone wills to spend time on going
deeper. Generally speaking - I think it comes from the "imperfectness" of
Python typing system and the fact that really at this moment the fields cannot
be None - because they are guaranteed to be set before, but I do not want to
spend time on going through all the paths to be honest - and prefer to get a
"defensive" approach - which will work and signal problems in case something
like that happens.
But if you or someone else would like to investigate - I have nothing
against it.
--
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]