fix: add --no-dags-base-dir flag for Airflow 3 DAG bundle compatibility#2001
Merged
jeremybeard merged 3 commits intoastronomer:mainfrom Feb 6, 2026
Merged
Conversation
Adds opt-in flag to exclude the dags/ directory prefix from DAG bundles. This is needed for Airflow 3.x where sys.path includes the bundle root, causing imports from shared modules in dags/ to fail. Usage: astro deploy --dags --no-dags-base-dir Fixes astronomer#1985
8cec072 to
06d95af
Compare
jeremybeard
approved these changes
Feb 6, 2026
| }) | ||
| } | ||
|
|
||
| func TestDeployDagsBundleLayout(t *testing.T) { |
Contributor
There was a problem hiding this comment.
This is really just testing that the negation operator still works but I guess you can never be too careful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--no-dags-base-dirflag toastro deploy --dagsfor Airflow 3.x compatibilitydags/directory prefix (existing behavior)--no-dags-base-dir, DAG files are placed at the bundle rootUsage
Context
Airflow 3 changed the DAG processor to add the bundle root to
sys.pathinstead of thedags/folder. This caused imports from shared modules in thedags/directory to fail for DAG-only deploys.This flag gives users explicit control over the bundle layout without changing default behavior.
Fixes #1985