alvinzhangdd commented on code in PR #54775:
URL: https://github.com/apache/airflow/pull/54775#discussion_r2291848471
##########
airflow/serialization/serialized_objects.py:
##########
@@ -1708,7 +1709,8 @@ def deserialize_dag(cls, encoded_dag: dict[str, Any]) ->
SerializedDAG:
elif k == "dagrun_timeout":
v = cls._deserialize_timedelta(v)
elif k.endswith("_date"):
- v = cls._deserialize_datetime(v)
+ if isinstance(v, (int, float)):
Review Comment:
This is the dag level start_date and end_date.
Same scenario, if someone assigns start_date, end_date as jinjia template
and pass to dag.
This would skip, would it cause issue if dag-level start_date is null?
##########
airflow/serialization/serialized_objects.py:
##########
@@ -1306,7 +1306,8 @@ def populate_operator(cls, op: Operator, encoded_op:
dict[str, Any]) -> None:
elif k == "resources":
v = Resources.from_dict(v)
elif k.endswith("_date"):
- v = cls._deserialize_datetime(v)
+ if isinstance(v, (int, float)):
Review Comment:
This is task level, let's set the scenario: someone assigns end_date =
jinjia template, and pass it to the task level, and stores to serialized_dag.
In this scenario, it skips the string end_date, but would the deserialized
object in create_dag_run populate a default value for the task level end_date?
if not would it create null end_date and cause issue?
In the production example, we saw task level start_date was serialized to
the dag-level start_date, and is a correct float, but end_date was serialized
as the template string.
--
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]