itayweb commented on code in PR #61550:
URL: https://github.com/apache/airflow/pull/61550#discussion_r3423921560
##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -609,7 +633,23 @@ def create_dagrun(
self.validate_partition_key(partition_key)
# todo: AIP-78 add verification that if run type is backfill then we
have a backfill id
- copied_params = self.params.deep_merge(conf)
+
+ # When triggering against a specific bundle version, validate conf
against that
+ # version's param schema (not the live dag's), so callers get the
right errors.
+ if bundle_version is not None and not self.disable_bundle_versioning:
+ if dag_version is None:
+ dag_version = DagVersion.get_latest_version(
+ self.dag_id, bundle_version=bundle_version,
load_serialized_dag=True, session=session
+ )
+ if not dag_version:
+ raise DagVersionNotFound(
+ f"DAG with dag_id: '{self.dag_id}' does not have a
version for bundle_version '{bundle_version}'"
+ )
+ params_dag = dag_version.serialized_dag.dag
Review Comment:
Done
##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -71,6 +78,21 @@
log = structlog.get_logger(__name__)
+# Callbacks are not serialized, so when running an older bundle version we
copy them
+# from the live dag to the resolved dag so dag-level event hooks still fire
correctly.
+# Other DAG-level attrs (max_active_runs, catchup, params, …) intentionally
come from
+# the old serialized version, since the caller asked for that specific
historical snapshot.
+_DAG_CALLBACK_ATTRS = (
+ "sla_miss_callback",
+ "on_success_callback",
+ "on_failure_callback",
+ "on_retry_callback",
+ "on_execute_callback",
+ "on_skipped_callback",
+ "has_on_success_callback",
+ "has_on_failure_callback",
+)
Review Comment:
Done
--
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]