-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Viewing Dag Code for Stateless Webserver #8159
Conversation
Note: This PR is for v1-10-test branch to fix 1.10.10rc3 . I will port this to Master branch once we release 1.10.10 |
cc @anitakar |
|
||
def code(self): | ||
@classmethod | ||
def code(cls, fileloc): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this method name. It describes what he does. It does not contain any verb. However, this is not related to this PR. It should be get_code_by_fileloc
or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a separate PR to improve the code in this file, that I have targetted against Master but yeah that is not the priority for now.
This bug was found by @KostyaEsmukov
Details in #8151 (comment)
Basically when DagCode was instantiated it read the source code from Dag File, hence when the Webserver does not have access to the Dag File, it used to fail with FileNotFoundError:
This PR fixes this and adds additional tests to validate this behavior
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.