Skip to content

Conversation

@dimberman
Copy link
Contributor

@dimberman dimberman commented Nov 25, 2020

Adds an upgrade check rule that ensures that users are not using custom
metaclasses in their custom operators

Fixes #11038


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

Adds an upgrade check rule that ensures that users are not using custom
metaclasses in their custom operators


def check_task_for_metaclasses(task):
class_type = type(task.__class__)
Copy link
Member

Choose a reason for hiding this comment

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

Nice! 🚀

Copy link
Member

@turbaszek turbaszek left a comment

Choose a reason for hiding this comment

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

LGTM! Tested this locally 👌

@github-actions
Copy link

The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it!

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 26, 2020
@kaxil kaxil merged commit 847820f into v1-10-stable Nov 27, 2020
@kaxil kaxil deleted the custom-operator-metaclass-rule branch November 27, 2020 11:38
@potiuk potiuk added this to the Airflow 1.10.14 milestone Nov 30, 2020
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
Adds an upgrade check rule that ensures that users are not using custom
metaclasses in their custom operators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create CustomOperatorUsesMetaclassRule to ease upgrade to Airflow 2.0

5 participants