Add /files/dags to PYTHONPATH in Breeze#61436
Open
jason810496 wants to merge 1 commit intoapache:mainfrom
Open
Add /files/dags to PYTHONPATH in Breeze#61436jason810496 wants to merge 1 commit intoapache:mainfrom
jason810496 wants to merge 1 commit intoapache:mainfrom
Conversation
Fix path Fix comments
2 tasks
Member
|
Hmm. I think that should not be the case - at least by default when Airflow imports Dags (whether it's in Triggerer, worker or Dag Processor), it should add bundle root to the PYTHONPATH automatically - and we should avoid adding it externally- if we see a problem that it is not added, we should fix it. @jedcunningham @ephraimbuddy - am I right ? |
Member
|
Correct (edit: mostly). In fact, triggers from Dag files was pretty broken before anyways, so we intentionally removed that ability in AF3. edit:
Yes for worker and dag processor. But not for the triggerer - the single process architecture means you can't do it reliably. |
Member
|
See #48603. |
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.
Why
The default dags path in Breeze will be
/files/dags, but/files/dagsis not inPYTHONPATH, which cause the triggers defined in Dag file are not able to import by Triggerer, and have to workaround by copying Dag file to some directories that are inPYTHONPATH. Pointed out in: #58676 (comment)What
We should add
/files/dagstoPYTHONPATHin Breeze in case the triggers are defined in dags, and cause "unable to import trigger" during Triggerer runtime.Before:
/files/dagsis not inPYTHONPATHAfter:
/files/dagsis now inPYTHONPATH