Skip to content

Conversation

@simi
Copy link
Contributor

@simi simi commented Sep 19, 2025

This fixes various entrypoints to DAGs where path wasn't updated like various cli DAG commands like airflow dags test.

I have tested various entrypoints locally - using full Airflow deployment, using local standalone airflow, running DAGs thru UI, running DAGs thru CLI, serializing DAGs thru processor, serializing DAGs thru CLI.

/cc @potiuk

@ashb
Copy link
Member

ashb commented Sep 20, 2025

This is also affecting 3.0 right? (That is, this isn't a new regression in 3.1?)

@simi
Copy link
Contributor Author

simi commented Sep 20, 2025

This is also affecting 3.0 right? (That is, this isn't a new regression in 3.1?)

IMHO this was missed in 3.0.2 during some Task API refactorings (moving to DAG bundles). 3.0.1 works the same as 3.1 with this patch.

@jedcunningham
Copy link
Member

3.0.0/3.0.1 was arguably worse in the sense it naively added the AF2 dags dir instead of bundle root, even if it wasnt configured.

But yes, not a regression. Meaning, it should go in rc2 if merged and we have an rc2, but not enough to warrant an rc2 on its own.

@simi
Copy link
Contributor Author

simi commented Sep 20, 2025

t configured.

But yes, not a regression. Meaning, it should go in rc2 if merged and we have an rc2, but not enough to warrant an rc2 on its own.

That's my understanding also. 3.0.0 and 3.0.1 was actually wrong and this is actually improvement to bundle path to be appended when needed automatically so you doesn't need to do it manually on all obvious cases.

@simi
Copy link
Contributor Author

simi commented Sep 23, 2025

@jedcunningham would you mind to help me resolve the one comment? I have no idea what's requested there and rc2 is around the corner. 🙏

@jedcunningham
Copy link
Member

Sorry, thought I'd replied to the task thing, I assume thats what you meant? Shout if you have other questions.

(Missed rc2 though)

@simi
Copy link
Contributor Author

simi commented Sep 23, 2025

@jedcunningham I'm not sure I do follow ... and .... comments, but I did my best to fix styling and the append.

@jedcunningham
Copy link
Member

Those are literal ..., or pass - you can have a dag without tasks :) (the 4 dots was a typo, sorry)

@simi
Copy link
Contributor Author

simi commented Sep 24, 2025

Those are literal ..., or pass - you can have a dag without tasks :) (the 4 dots was a typo, sorry)

Ahh, I had no idea bout ..., I recognize pass. Thanks for sharing, I'm still relatively new to Python 🐍 world.

@simi
Copy link
Contributor Author

simi commented Sep 24, 2025

ℹ️ rebased and squashed after #55139 merge. @potiuk would you mind to check also?

@simi
Copy link
Contributor Author

simi commented Sep 24, 2025

updated @jedcunningham

@simi simi force-pushed the dagbag-syspath branch 2 times, most recently from 5ee682a to 00a1cb4 Compare January 6, 2026 17:30
@simi simi marked this pull request as ready for review January 6, 2026 18:34
@simi simi requested review from jedcunningham and potiuk January 8, 2026 01:47
@uranusjr
Copy link
Member

uranusjr commented Jan 8, 2026

A couple of things we should fix, but otherwise I think this is good!

@uranusjr uranusjr removed stale Stale PRs per the .github/workflows/stale.yml policy file type:bug-fix Changelog: Bug Fixes backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jan 8, 2026
simi added 3 commits January 8, 2026 10:31
- it is intended to pass it to DagBag only for ephemeral processes
- usefor CLI and other one-off DagBag instances 'polluting' sys.path
@simi
Copy link
Contributor Author

simi commented Jan 8, 2026

@uranusjr update. Not sure if the warning is not too much. I did it this way to keep the kw args to BundleDagBag the same as DagBag. Looking at the usage, maybe it is not worth it and it will be better to strip only to currently used kw params and provide safe defaults for the others.

@simi simi force-pushed the dagbag-syspath branch 2 times, most recently from f196d7b to d6df95f Compare January 8, 2026 14:07
@uranusjr
Copy link
Member

uranusjr commented Jan 9, 2026

Agree with your latest comment, but we’ll need to do this for compat reasons. Feel free to submit refactoring PRs after this if you feel like reworking it; we can discuss what needs to be done there.

@simi
Copy link
Contributor Author

simi commented Jan 9, 2026

Good to squash now and update the commit message?

@potiuk potiuk merged commit d7c9a0a into apache:main Jan 9, 2026
101 checks passed
@potiuk
Copy link
Member

potiuk commented Jan 9, 2026

Good to squash now and update the commit message?

No need. We use "squash & merge" as the only way to merge PRs so they are always squashed into single commit when we merge.

@simi simi deleted the dagbag-syspath branch January 9, 2026 12:48
@simi
Copy link
Contributor Author

simi commented Jan 9, 2026

🥳 Thanks everyone for a guidance and patience!

It is actually my 🎂 today, this is nice accidental 🎁!

@potiuk
Copy link
Member

potiuk commented Jan 9, 2026

Happy BDay ! Glad we could make it better!

stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
…e#55894)

* Add bundle_path temporarily to sys.path during DagBag parsing.

* Add bundle_path to sys.path permanently.

- it is intended to pass it to DagBag only for ephemeral processes

* Introduce BundleDagBag for ephemeral pre-loaded bundle path usage.

- usefor CLI and other one-off DagBag instances 'polluting' sys.path

* Remove from backwards compatible layer. Ignore include_examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dags folder not present in PYTHONPATH

7 participants