henry3260 commented on code in PR #68583:
URL: https://github.com/apache/airflow/pull/68583#discussion_r3464902548


##########
airflow-core/tests/unit/dag_processing/test_dagbag.py:
##########
@@ -360,6 +360,16 @@ def test_dagbag_with_bundle_name(self, tmp_path):
         dagbag2 = DagBag(dag_folder=os.fspath(tmp_path))
         assert dagbag2.bundle_name is None
 
+    def test_dag_with_bundle_name(self, tmp_path):
+        """Test that bundle_name is attached to each Dag in the DagBag."""
+        dagbag = DagBag(dag_folder=os.fspath(tmp_path), 
bundle_name="test_bundle")
+        for dag in dagbag.dags.values():
+            assert dag.bundle_name == "test_bundle"
+
+        dagbag2 = DagBag(dag_folder=os.fspath(tmp_path))
+        for dag in dagbag2.dags.values():
+            assert dag.bundle_name is None
+

Review Comment:
   We should use a real path



##########
airflow-core/src/airflow/dag_processing/dagbag.py:
##########
@@ -337,6 +337,10 @@ def process_file(self, filepath, only_if_updated=True, 
safe_mode=True):
             try:
                 if dag.fileloc is None:
                     dag.fileloc = filepath
+
+                # Add the bundle_name to the DAG

Review Comment:
   ```suggestion
                   # Add the bundle_name to the Dag
   ```



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