Copilot commented on code in PR #64945:
URL: https://github.com/apache/airflow/pull/64945#discussion_r3066483887


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1298,13 +1295,12 @@ def test(
                 for bundle in manager.get_all_dag_bundles():
                     if not bundle.is_initialized:
                         bundle.initialize()
-                    with _airflow_parsing_context_manager(dag_id=self.dag_id):
-                        dagbag = BundleDagBag(
-                            dag_folder=bundle.path,
-                            bundle_path=bundle.path,
-                            bundle_name=bundle.name,
-                        )
-                        sync_bag_to_db(dagbag, bundle.name, bundle.version)
+                    dagbag = BundleDagBag(
+                        dag_folder=bundle.path,
+                        bundle_path=bundle.path,
+                        bundle_name=bundle.name,
+                    )
+                    sync_bag_to_db(dagbag, bundle.name, bundle.version)
                     version = DagVersion.get_version(self.dag_id)
                     if version:
                         break

Review Comment:
   The bundle sync loop still breaks as soon as the *current* DAG’s DagVersion 
is found. That means bundles later in `get_all_dag_bundles()` will not be 
parsed/synced, so `dag.test()` can still hit the same 404 when 
`TriggerDagRunOperator` targets a DAG that lives in a different (later) bundle. 
If the goal is to make triggered DAGs visible to the in-process Execution API, 
this should continue syncing all configured bundles (or otherwise ensure the 
target DAG(s) are synced) rather than breaking early.



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