amoghrajesh commented on code in PR #75584:
URL: https://github.com/apache/airflow/pull/75584#discussion_r4375867192
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1490,25 +1492,29 @@ def _is_excluded(cls, var: Any, attrname: str, op:
SDKDAGNode) -> bool:
schema_defaults = cls.get_schema_defaults("operator")
if attrname in schema_defaults:
- if schema_defaults[attrname] == var:
+ comparison_value = var.total_seconds() if isinstance(var,
datetime.timedelta) else var
+ if schema_defaults[attrname] == comparison_value:
# If it also matches client_defaults, exclude (optimization)
client_defaults = cls.generate_client_defaults()
if attrname in client_defaults:
- if client_defaults[attrname] == var:
+ if client_defaults[attrname] == comparison_value:
return True
# If client_defaults differs, preserve explicit override
from user
# Example: default_args={"retries": 0}, schema default=0,
client_defaults={"retries": 3}
- if client_defaults[attrname] != var:
- if op.has_dag():
- dag = op.dag
- if dag and attrname in dag.default_args and
dag.default_args[attrname] == var:
+ if client_defaults[attrname] != comparison_value:
+ override_sources = (
+ op.dag.default_args if op.has_dag() and op.dag
else {},
+ getattr(op, "_BaseOperator__init_kwargs", {}),
+ getattr(op, "partial_kwargs", {}),
Review Comment:
Unrelated? Adding `partial_kwargs` to the override sources goes beyond what
issue #75547 asked for I think??
--
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]