aaron-y-chen commented on code in PR #72906:
URL: https://github.com/apache/airflow/pull/72906#discussion_r4351479954


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1378,7 +1384,14 @@ def test(
                     dag_folder=bundle.path,
                     bundle_path=bundle.path,
                     bundle_name=bundle.name,
+                    collect_dags=False,
                 )
+                files_to_parse = _dag_test_files_to_sync(self, bundle, 
session=session)
+                if files_to_parse is not None:
+                    for file_path in files_to_parse:
+                        dagbag.collect_dags(dag_folder=file_path)
+                if files_to_parse is None or self.dag_id not in dagbag.dags:

Review Comment:
   After an initial sync, if `child` moves from `old.py` to `new.py` while 
`old.py` remains for another Dag, `parent.test()` appears to trigger the stale 
serialized child. The recorded path still exists, so only `parent.py` and 
`old.py` are parsed. Since the parent is collected, this condition skips bundle 
discovery even though `child` is absent from the bag. The updated child in 
`new.py` is never synced, and the trigger uses its previous definition from the 
metadata DB.



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