simi commented on code in PR #55894:
URL: https://github.com/apache/airflow/pull/55894#discussion_r2365724096
##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -398,12 +398,23 @@ def handler(signum, frame):
def parse(mod_name, filepath):
try:
- loader = importlib.machinery.SourceFileLoader(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)
- return [new_module]
+ # Add bundle path to sys.path if we have one
+ bundle_path_added = False
+ if self.bundle_path and str(self.bundle_path) not in sys.path:
+ sys.path.insert(0, str(self.bundle_path))
Review Comment:
I would go with append, since it was used previously.
--
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]