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


##########
airflow/models/baseoperator.py:
##########
@@ -292,34 +312,11 @@ def partial(
         "doc_yaml": doc_yaml,
     }
 
-    DEFAULT_VALUES: dict[str, Any] = {
-        "owner": DEFAULT_OWNER,
-        "trigger_rule": DEFAULT_TRIGGER_RULE,
-        "depends_on_past": False,
-        "ignore_first_depends_on_past": DEFAULT_IGNORE_FIRST_DEPENDS_ON_PAST,
-        "wait_for_past_depends_before_skipping": 
DEFAULT_WAIT_FOR_PAST_DEPENDS_BEFORE_SKIPPING,
-        "wait_for_downstream": False,
-        "retries": DEFAULT_RETRIES,
-        "queue": DEFAULT_QUEUE,
-        "pool_slots": DEFAULT_POOL_SLOTS,
-        "execution_timeout": DEFAULT_TASK_EXECUTION_TIMEOUT,
-        "retry_delay": DEFAULT_RETRY_DELAY,
-        "retry_exponential_backoff": False,
-        "priority_weight": DEFAULT_PRIORITY_WEIGHT,
-        "weight_rule": DEFAULT_WEIGHT_RULE,
-        "inlets": [],
-        "outlets": [],
-    }
+    # Populate kwargs from DAG-level default args.
+    partial_kwargs.update((k, v) for k, v in dag_default_args.items() if 
partial_kwargs.get(k) is NOTSET)
 
-    # Override NOTSET kwargs by dag default values
-    for k, v in default_partial_kwargs.items():
-        if partial_kwargs.get(k) is NOTSET:
-            partial_kwargs[k] = v
-
-    # Override NOTSET kwargs which don't have a dag default value by Airflow 
default value or None
-    partial_kwargs = {
-        k: v if v is not NOTSET else DEFAULT_VALUES.get(k, None) for k, v in 
partial_kwargs.items()
-    }
+    # Populate kwargs from Airflow default constants.
+    partial_kwargs.update((k, v) for k, v in _PARTIAL_DEFAULTS.items() if 
partial_kwargs.get(k) is NOTSET)

Review Comment:
   Change this back.



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