Replies: 1 comment 3 replies
|
The safest current solution is to make shared code an installed Python package. Build A second option is to make the repository root the bundle path and use A separate So I would use package installation as the supported deployment pattern today. If this becomes an API proposal, keeping |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A DAG bundle can contain DAG files together with shared Python modules, configuration files, and other resources.
For example:
The DAG may import shared code using:
In this structure:
Airflow should scan only repository/project/dags for DAG files.
Python imports need repository on sys.path.
Current behavior:
BaseDagBundle.path is currently used for both:
For example, configuring GitDagBundle with:
limits DAG discovery to that directory. However, only this subdirectory is added to sys.path, so the following import fails:
Proposed solution
Add an
import_rootproperty toBaseDagBundle:The default keeps the existing behaviour.
A bundle with separate discovery and import roots could implement:
Similar discussion
Let me know if this is useful, and the solution is acceptable.
I am willing to contribute to this change if accepted, thanks
All reactions