8000 mypy version bump 1.12.0 by dirrao · Pull Request #39850 · apache/airflow · GitHub
[go: up one dir, main page]

Skip to content

mypy version bump 1.12.0 #39850

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

Closed
wants to merge 16 commits into from
Closed

mypy version bump 1.12.0 #39850

wants to merge 16 commits into from

Conversation

dirrao
Copy link
Contributor
@dirrao dirrao commented May 26, 2024

mypy version bump 1.12.0

@potiuk potiuk force-pushed the mypy_version_bump branch from 77db1ae to bdef4cd Compare May 26, 2024 21:08
Copy link
Member
@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

We’re hitting python/typeshed#10653 (giving this a red cross to avoid accidental merge)

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 Jul 12, 2024
@potiuk potiuk removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jul 12, 2024
@potiuk
Copy link
Member
potiuk commented Jul 12, 2024

@dirrao - are you continuing with that :) ?

@dirrao
Copy link
Contributor Author
dirrao commented Jul 12, 2024

@dirrao - are you continuing with that :) ?

Yes. We are waiting from the upstream to fix the bug.

@dirrao dirrao changed the title mypy version bump 1.10.0 mypy version bump 1.11.0 Jul 26, 2024
@dirrao
Copy link
Contributor Author
dirrao commented Jul 29, 2024

@uranusjr
Are we need to adjust the existing to fix failing checks? Can please check once?

@dirrao dirrao force-pushed the mypy_version_bump branch from afe1cfa to 001441d Compare July 29, 2024 12:01
@dirrao dirrao closed this Jul 29, 2024
@dirrao dirrao reopened this Jul 29, 2024
@dirrao
Copy link
Contributor Author
dirrao commented Aug 1, 2024

@uranusjr Can you help me on the failing check?

@dirrao dirrao requested a review from potiuk August 1, 2024 16:32
@dirrao
Copy link
Contributor Author
dirrao commented Aug 3, 2024

@potiuk
We are seeing the issue related to typecasting. Do we need this explicit type casting?

airflow/models/dag.py:2760: error: "TaskDecoratorCollection" not callable 
[120](https://github.com/apache/airflow/actions/runs/10155935894/job/28083658202?pr=39850#step:6:121)
[misc]
[121](https://github.com/apache/airflow/actions/runs/10155935894/job/28083658202?pr=39850#step:6:122)
            return cast("TaskDecoratorCollection", functools.partial(task,...
[122](https://github.com/apache/airflow/actions/runs/10155935894/job/28083658202?pr=39850#step:6:123)
                                                   ^
[123](https://github.com/apache/airflow/actions/runs/10155935894/job/28083658202?pr=39850#step:6:124)
Found 1 error in 1 file (checked 1238 source files)
[124](https://github.com/apache/airflow/actions/runs/10155935894/job/28083658202?pr=39850#step:6:125)
Error 1 returned

@uranusjr uranusjr force-pushed the mypy_version_bump branch from c6c9deb to 2623b45 Compare August 5, 2024 07:38
@uranusjr
Copy link
Member
uranusjr commented Aug 5, 2024

The errore does not even make sense to me… TaskDecoratorCollection is callable (it has __call__ defined).

@uranusjr uranusjr requested review from kaxil, XD-DENG and ashb as code owners August 5, 2024 07:54
@uranusjr uranusjr force-pushed the mypy_version_bump branch from d1ebe2e to 2623b45 Compare August 5, 2024 08:53
@uranusjr uranusjr removed request for ashb, kaxil and XD-DENG August 5, 2024 08:53
Mypy is weirdly complaining it can't convert a callable to a
TaskDecoratorCollection since the type is not callable. This is wrong
in both ways---TaskDecoratorCollection *is* totally callable, and isn't
cast() supposed to not care anyway?

I don't see there's a viable way to work around this without
significantly impacting typing in other ways, so an ignore marker seems
to be the most reasonable option. The cast() call is kept because Mypy
might fix this ins the future, and when it does, it should report the
marker as redundant and prompt us to remove it.
@uranusjr
Copy link
Member
uranusjr commented Aug 6, 2024

The partial issue looks similar to python/mypy#17631

1.11 added special support for partial and that seems to break cases like this. (Not sure what the criteria are exactly.) python/mypy#16939

@uranusjr
Copy link
Member
uranusjr commented Aug 6, 2024

Also

/usr/local/lib/python3.8/site-packages/apache_beam/typehints/schemas.py:486: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at [https://github.com/python/mypy/issues](https://github.com/python/mypy/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)
version: 1.11.0
/usr/local/lib/python3.8/site-packages/apache_beam/typehints/schemas.py:486: : note: please use --show-traceback to print a traceback when reporting a bug

@hauntsaninja
Copy link

Try mypy 1.12 , we fixed at least one issue related to functools.partial that should help

@dirrao dirrao changed the title mypy version bump 1.11.0 mypy version bump 1.12.0 Oct 19, 2024
Copy link
@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Looks like there are a few things from CI that need changes

@@ -215,7 +215,7 @@
# TODO: upgrade to newer versions of MyPy continuously as they are released
# Make sure to upgrade the mypy version in update-common-sql-api-stubs in .pre-commit-config.yaml

Choose a reason for hiding this comment

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

should be updated in update-common-sql-api-stubs as per comment?

Copy link
github-actions bot commented Dec 5, 2024

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 Dec 5, 2024
@github-actions github-actions bot closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0