Skip to content

Conversation

@milton0825
Copy link
Contributor

@milton0825 milton0825 commented Apr 8, 2019

Co-authored-by: Max Payton [email protected]

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

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.

Screen Shot 2019-04-11 at 11 45 54 PM

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

Code Quality

  • Passes flake8

@milton0825 milton0825 force-pushed the operator-extra-links branch from eab3ac1 to 0257ba5 Compare April 8, 2019 05:58
@milton0825 milton0825 changed the title [AIRFLOW-161] New redirect route and extra links [AIRFLOW-161][WIP] New redirect route and extra links Apr 8, 2019
@milton0825 milton0825 force-pushed the operator-extra-links branch 4 times, most recently from 703abb0 to ba1262d Compare April 11, 2019 07:22
@milton0825 milton0825 changed the title [AIRFLOW-161][WIP] New redirect route and extra links [AIRFLOW-161] New redirect route and extra links Apr 11, 2019
@milton0825 milton0825 force-pushed the operator-extra-links branch 7 times, most recently from dd95410 to ed54066 Compare April 11, 2019 07:52
@codecov-io
Copy link

codecov-io commented Apr 11, 2019

Codecov Report

Merging #5059 into master will increase coverage by 0.03%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
airflow/contrib/operators/qubole_operator.py 86.79% <100%> (+1.07%) ⬆️
airflow/models/baseoperator.py 94.03% <90.9%> (-0.11%) ⬇️
airflow/contrib/hooks/qubole_hook.py 55% <90.9%> (+3.06%) ⬆️
airflow/www/views.py 76.38% <90.9%> (+0.35%) ⬆️
airflow/models/taskinstance.py 92.59% <0%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86422e7...76f8885. Read the comment docs.

@milton0825 milton0825 changed the title [AIRFLOW-161] New redirect route and extra links [AIRFLOW-161][WIP] New redirect route and extra links Apr 11, 2019
@milton0825 milton0825 force-pushed the operator-extra-links branch from d2c616b to ebe1e05 Compare April 11, 2019 17:22
@milton0825 milton0825 changed the title [AIRFLOW-161][WIP] New redirect route and extra links [AIRFLOW-161] New redirect route and extra links Apr 11, 2019
@milton0825
Copy link
Contributor Author

@feng-tao this is ready for another look.

Copy link
Contributor Author

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.

@feng-tao
Copy link
Member

will take a look tonight

Copy link
Member

@feng-tao feng-tao left a 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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Copy link
Member

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?

Copy link
Contributor Author

@milton0825 milton0825 Apr 12, 2019

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.

Copy link
Member

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 ?

Copy link
Contributor Author

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

Copy link
Contributor Author

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:

__metaclass__ = ABCMeta

@feng-tao
Copy link
Member

also I saw you didn't modify any existing tests, why CI fails previously?

@milton0825 milton0825 changed the title [AIRFLOW-161] New redirect route and extra links [AIRFLOW-161][WIP] New redirect route and extra links Apr 12, 2019
@milton0825
Copy link
Contributor Author

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.
@milton0825 milton0825 force-pushed the operator-extra-links branch from bc7511b to 76f8885 Compare April 12, 2019 15:20
@milton0825 milton0825 changed the title [AIRFLOW-161][WIP] New redirect route and extra links [AIRFLOW-161] New redirect route and extra links Apr 12, 2019
@milton0825
Copy link
Contributor Author

@feng-tao ready for another look

Copy link
Member

@feng-tao feng-tao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. lgtm

@feng-tao feng-tao merged commit b282aae into apache:master Apr 12, 2019
@milton0825 milton0825 deleted the operator-extra-links branch April 13, 2019 19:03
cthenderson pushed a commit to cthenderson/apache-airflow that referenced this pull request Apr 16, 2019
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') }}" +
Copy link
Member

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
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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)

https://cwiki.apache.org/confluence/display/AIRFLOW/Season+of+Docs+2019

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.

ashb pushed a commit to ashb/airflow that referenced this pull request Jun 20, 2019
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)
andriisoldatenko pushed a commit to andriisoldatenko/airflow that referenced this pull request Jul 26, 2019
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.
wmorris75 pushed a commit to modmed-external/incubator-airflow that referenced this pull request Jul 29, 2019
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.
dharamsk pushed a commit to postmates/airflow that referenced this pull request Aug 8, 2019
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants