ephraimbuddy commented on code in PR #68336:
URL: https://github.com/apache/airflow/pull/68336#discussion_r3412977518
##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -687,9 +687,21 @@ def write_dag(
and dag_version
and dag_version.bundle_name == bundle_name
):
- if name_updated:
- # The serialized DAG itself is unchanged, but deadline alert
name(s) were
- # updated in the DB, so report True so callers know a write
did occur.
+ # Serialized content is unchanged, so we don't create a new
DagVersion.
+ # But if the bundle advanced, refresh the latest version's pointer
in place — tasks resolve
+ # their code from ``ti.dag_version.bundle_version`` at run time,
so a stale
+ # pointer makes runs execute an outdated commit.
+ bundle_metadata_changed = (
+ dag_version.bundle_version != bundle_version or
dag_version.version_data != version_data
Review Comment:
I think a hash should be a follow up. And since python `or` short-circuits,
it will be rare for bundle_version to not be equal to bundle_version, hence
only on rare occasion will the version_data be compared. I prefer to do it as a
follow up as it would likely involve a new column to store the hash otherwise,
it won't be beneficial doing it on the fly
--
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]