-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[AIRFLOW-3865] Added api to get python code of a given Dag id #4687
Conversation
3b06355
to
9dcfb03
Compare
|
||
def get_code(dag_id): | ||
"""Return python code of a given dag_id.""" | ||
dagbag = DagBag() |
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.
This is a potentially expensive operation (as it will load all dags from disk!)
Could you instead do something like in #4407 where we load the dag model from the DB instead.
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.
Thanks @ashb . Incorporated it
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.
@ashb could you please review it and provide your feedback/comments
33a9f80
to
4451835
Compare
4451835
to
706c7b2
Compare
Codecov Report
@@ Coverage Diff @@
## master #4687 +/- ##
==========================================
- Coverage 74.35% 74.31% -0.04%
==========================================
Files 430 431 +1
Lines 27964 27988 +24
==========================================
+ Hits 20792 20800 +8
- Misses 7172 7188 +16
Continue to review full report at Codecov.
|
Make sure you have checked all steps below.
Jira
Description
It exposes an Api to get code of a given DagId
Tests
PR added a UT to test get_dag_code Api
Commits
Documentation
Code Quality
flake8