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

Refactor operator links to not create ad hoc TaskInstances #21285

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

josh-fell
Copy link
Contributor

@josh-fell josh-fell commented Feb 3, 2022

Given that there is now a foreign key constraint between TaskInstance and DagRun, ideally ad hoc TaskInstance objects shouldn't be created within operator links. See this comment.

Almost all of the existing operator links can be refactored to using XCom.get_one() to pull the necessary XCom to generate the URL needed.


^ 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.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon-aws AWS/Amazon - related issues provider:microsoft-azure Azure-related issues provider:google Google (including GCP) related issues labels Feb 3, 2022
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Feb 3, 2022
@josh-fell josh-fell marked this pull request as ready for review February 3, 2022 04:22
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Nice one.

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.

❤️ it

@potiuk
Copy link
Member

potiuk commented Feb 3, 2022

Merging. The only failure is the MsSQL that I work on in #21272

@potiuk potiuk merged commit ddb5246 into apache:main Feb 3, 2022
@josh-fell josh-fell deleted the operator-links-no-taskinstances branch February 3, 2022 16:24
josh-fell added a commit to josh-fell/airflow that referenced this pull request Feb 22, 2022
@jedcunningham jedcunningham added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Mar 1, 2022
josh-fell added a commit to josh-fell/airflow that referenced this pull request Dec 9, 2023
This operator link creates an ad hoc TaskInstance to build its output URL. Generally we moved away from this approach starting with apache#21285.

This PR updates the operator link to use `TaskInstance.get_task_instance()` instead.
josh-fell added a commit to josh-fell/airflow that referenced this pull request Dec 9, 2023
This operator link creates an ad hoc TaskInstance to build its output URL. Generally we moved away from this approach starting with apache#21285.

This PR updates the operator link to use `TaskInstance.get_task_instance()` instead.
josh-fell added a commit to josh-fell/airflow that referenced this pull request Dec 9, 2023
This operator link creates an ad hoc TaskInstance to build its output URL. Generally we moved away from this approach starting with apache#21285.

This PR updates the operator link to use `TaskInstance.get_task_instance()` instead.
josh-fell added a commit to josh-fell/airflow that referenced this pull request Dec 9, 2023
This operator link creates an ad hoc TaskInstance to build its output URL. Generally we moved away from this approach starting with apache#21285.

This PR updates the operator link to use `TaskInstance.get_task_instance()` instead.
potiuk pushed a commit that referenced this pull request Dec 10, 2023
This operator link creates an ad hoc TaskInstance to build its output URL. Generally we moved away from this approach starting with #21285.

This PR updates the operator link to use `TaskInstance.get_task_instance()` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues provider:microsoft-azure Azure-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants