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

Fix weight_rule property type in mappedoperator #35257

Merged
merged 1 commit into from Oct 31, 2023

Conversation

hussein-awala
Copy link
Member

No description provided.

def weight_rule(self) -> int: # type: ignore[override]
def weight_rule(self) -> str: # type: ignore[override]
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need type: ignore here?

Copy link
Contributor

Choose a reason for hiding this comment

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

We may not need it. Now, that we changed the return type from int to str, MappedOperator.weight_rule no longer deviates from it's parent AbstractOperator.weight_rule of type string.

Copy link
Member Author

Choose a reason for hiding this comment

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

The weight_rule is defined in the superclass (AbstractOperator) as a normal attribute, but here, we override it to a property, so Mypy doesn't like this override. We have the same ignore for all the overridden attributes.

@eladkal eladkal added this to the Airflow 2.7.3 milestone Oct 30, 2023
@eladkal eladkal merged commit 6276c40 into apache:main Oct 31, 2023
44 checks passed
@eladkal eladkal modified the milestones: Airflow 2.7.3, Airflow 2.7.4 Oct 31, 2023
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants