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

Remove explicit annotaion for Mypy to infer type #32670

Closed
wants to merge 1 commit into from

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jul 18, 2023

This allows task() to have the correct return type instead of being Any and make everything untyped.

I’m not sure why Any was added in the first place, but Mypy seems to be fine with this change locally on my machine, so let’s see how it goes in CI. It did improve a lot since a year ago.

Fix #32384.

@eladkal eladkal added this to the Airflow 2.6.4 milestone Jul 18, 2023
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Jul 18, 2023
@uranusjr
Copy link
Member Author

Hah, static check is failing. Not unexpected.

@benbuckman
Copy link

@uranusjr what's the status of this, can this be fixed/merged?

Thanks!

This allows task() to have the correct return type instead of being Any
and make everything untyped.
@eladkal
Copy link
Contributor

eladkal commented Oct 27, 2023

Needs another rebase after #35222

@eladkal
Copy link
Contributor

eladkal commented Nov 8, 2023

@uranusjr needs another rebase

@zach-nicoll-wcq
Copy link

@uranusjr would love to see this merged!

@uranusjr
Copy link
Member Author

uranusjr commented Dec 5, 2023

Note that Mypy is not happy about this change. If you would like this to go in, feel free to build on this change and make Mypy pass.

@itstalmeez
Copy link

Addresses issue #32384 by updating the return type of task() to the correct type, removing the 'Any' type and ensuring everything is properly typed. The initial inclusion of 'Any' in the return type is unclear, and though I'm uncertain of its original purpose, locally testing with Mypy shows compatibility with this change.

Let's monitor the CI results to confirm its effectiveness across different environments. It's worth noting that Mypy has improved significantly over the past year, and this adjustment aligns with the ongoing efforts to enhance type safety. Your feedback and observations are welcome as we evaluate the impact of this modification.

Thank you for bringing attention to this issue, and I look forward to collaborating on its resolution.

@ephraimbuddy ephraimbuddy removed this from the Airflow 2.8.1 milestone Jan 15, 2024
@ephraimbuddy ephraimbuddy added this to the Airflow 2.8.2 milestone Jan 15, 2024
@eladkal eladkal removed this from the Airflow 2.9.0 milestone Mar 7, 2024
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 30, 2024
@github-actions github-actions bot closed this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PRs per the .github/workflows/stale.yml policy file type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type annotation for @task errors when called with parentheses/arguments
7 participants