-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[AIRFLOW-161] New redirect route and extra links #5059
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
Conversation
eab3ac1 to
0257ba5
Compare
703abb0 to
ba1262d
Compare
dd95410 to
ed54066
Compare
Codecov Report
@@ Coverage Diff @@
## master #5059 +/- ##
==========================================
+ Coverage 76.81% 76.85% +0.03%
==========================================
Files 463 463
Lines 29757 29816 +59
==========================================
+ Hits 22859 22914 +55
- Misses 6898 6902 +4
Continue to review full report at Codecov.
|
d2c616b to
ebe1e05
Compare
|
@feng-tao this is ready for another look. |
airflow/models/baseoperator.py
Outdated
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.
De-coupled how we define the link from the BaseOperator so that we can support global extra links (links shared by all operators) in the future easier.
|
will take a look tonight |
feng-tao
left a comment
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.
some small nits, we should add a doc on how to use the extra link feature. And could you post the screenshot on extra link feature as well?
airflow/contrib/hooks/qubole_hook.py
Outdated
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.
docstring
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.
added
airflow/contrib/hooks/qubole_hook.py
Outdated
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.
is there a reason we put the log as local variable not a global variable?
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.
Removed.
airflow/contrib/hooks/qubole_hook.py
Outdated
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.
do you what exception will be hit?
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.
Taking a closer look and I think we don't need the try...except and we can probably remove the Session.
airflow/models/baseoperator.py
Outdated
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.
is this compatible in both py2 and py3 ?
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.
tests passed so I would assume so
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.
We have the same usage in other places:
airflow/airflow/dag/base_dag.py
Line 32 in 6b38649
| __metaclass__ = ABCMeta |
|
also I saw you didn't modify any existing tests, why CI fails previously? |
|
Thanks for the review. The CI was failing previously because it is using the wrong endpoint. |
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow.
bc7511b to
76f8885
Compare
|
@feng-tao ready for another look |
feng-tao
left a comment
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.
nice. lgtm
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow.
| var markupArr = []; | ||
|
|
||
| $.each(extra_links, function(i, link){ | ||
| var url = "{{ url_for('Airflow.extra_links') }}" + |
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.
You should avoid Jinja in Javascript. I will correct it in my PR.
Reference:
#4787
| @@ -0,0 +1,53 @@ | |||
| .. Licensed to the Apache Software Foundation (ASF) under one | |||
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 not a good place to put this information. This section should contain information on how to use and not how to create operators
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 feel like it make sense to put all operator related docs all under one section, e.g. docs/howto/operator so that it is easier to users to find the related information.
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 think the doc has been reconstructed to put all the user phasing info.
@ashb , I think we need to define or provide clearer guideline on which doc should be put at which folder. Maybe through the season of doc initiative or an AIP.
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.
@milton0825 It makes sense, but only all the information about the operators would be in one place. This is not true in this case. I will suggest a different structure because I am concerned that the number of guides on the use of operators will grow rapidly. In this case, the guides about creating a new operator can be easily overlooked when it is just a small sub-point in large list.
I would like these fragment in a new page that will contain information on the creation of operators. As a part of SOD 2009, I proposed the project "4. How to create a workflow" and one of its expected deliverables is to create such a page.
A page for developing custom operators that includes:
- Describing mechanisms that are important when creating an operator, such as > template fields, UI color, hooks, connection, etc.
- Describing the responsibility between the operator and the hook
- Considerations for dealing with shared resources (such as connections and hooks)
As mentors of SOD project, I set a personal goal to improve the structure of the documentation. I agree that the recommendations will be useful and I will try to develop them.
I hope my explanations were helpful.
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow. (cherry-picked from commit b282aae)
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow.
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow.
Co-authored-by: Max Payton <[email protected]> With this change different operators would be able to customize the task instance model view with extra links, those can be used to redirect users to systems which are out of Airflow. (cherry-picked from commit b282aae)
Co-authored-by: Max Payton [email protected]
Jira
Description
With this change different operators would be able to customize the
task instance model view with extra links, those can be used to
redirect users to systems which are out of Airflow.
Tests
Commits
Documentation
Code Quality
flake8