kunaljubce commented on code in PR #59928:
URL: https://github.com/apache/airflow/pull/59928#discussion_r2686933939


##########
airflow-core/src/airflow/dag_processing/dagbag.py:
##########
@@ -439,7 +439,20 @@ def parse(mod_name, filepath):
                 spec = importlib.util.spec_from_loader(mod_name, loader)
                 new_module = importlib.util.module_from_spec(spec)
                 sys.modules[spec.name] = new_module
-                loader.exec_module(new_module)
+                module_dir = os.fspath(Path(filepath).parent)
+                # Insert module directory into sys.path to allow relative 
imports. Imp to note
+                # that this is just for the duration of 
`loader.exec_module(new_module)`, ensuring
+                # that helper modules located alongside the DAG are importable.
+                path_inserted = False

Review Comment:
   @Nataneljpwd You're right, this is an overkill. I will remove it.



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