Skip to content
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-6706] Lazy load operator extra links (#7327) #10318

Merged
merged 1 commit into from Aug 13, 2020

Conversation

turbaszek
Copy link
Member

closes: #10171


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
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.

Copy link
Contributor

@anitakar anitakar left a comment

Choose a reason for hiding this comment

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

When I was thinking about it, I preserved the old serialization the old way and new serialization the new way. But adding old here is much better.

@turbaszek
Copy link
Member Author

I tested it with:

# bq.py
from airflow.models import BaseOperatorLink


class BigQueryConsoleLink(BaseOperatorLink):
    name = 'BigQuery Console'

    def get_link(self, operator, dttm):
        return "teees"

and DAG:

class CustomOp(DummyOperator):
    @property
    def operator_extra_links(self):
        return (BigQueryConsoleLink(),)


with DAG("example_link",
    schedule_interval=None,  # Override to match your needs
    start_date=days_ago(1),
) as dag:
    task = CustomOp(task_id="task_withlink")

I added bq.BigQueryConsoleLink to BUILTIN_OPERATOR_EXTRA_LINKS and I see no atomic cloud <3

@turbaszek turbaszek requested a review from potiuk August 13, 2020 14:06
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

LGTM

@potiuk
Copy link
Member

potiuk commented Aug 13, 2020

SHll we un-draft and rerun it ?

@turbaszek turbaszek marked this pull request as ready for review August 13, 2020 14:08
@potiuk
Copy link
Member

potiuk commented Aug 13, 2020

airflow/plugins_manager.py:118:1: E303 too many blank lines (3)

@kaxil kaxil merged commit ccbe56a into apache:v1-10-test Aug 13, 2020
kaxil pushed a commit that referenced this pull request Aug 15, 2020
Co-authored-by: Kamil Breguła <mik-laj@users.noreply.github.com>
Backported from #7327
cherry-picked from b180e4b
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
Co-authored-by: Kamil Breguła <mik-laj@users.noreply.github.com>
Backported from apache#7327
cherry-picked from b180e4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants