Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions task-sdk/src/airflow/sdk/execution_time/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ def parse(what: StartupDetails, log: Logger) -> RuntimeTaskInstance:
)
bundle_instance.initialize()

# Put bundle root on sys.path if needed. This allows the dag bundle to add
# code in util modules to be shared between files within the same bundle.
if (bundle_root := os.fspath(bundle_instance.path)) not in sys.path:
sys.path.append(bundle_root)

dag_absolute_path = os.fspath(Path(bundle_instance.path, what.dag_rel_path))
bag = DagBag(
dag_folder=dag_absolute_path,
Expand Down