airflow icon indicating copy to clipboard operation
airflow copied to clipboard

mypy version bump 1.12.0

Open dirrao opened this issue 1 year ago • 10 comments

mypy version bump 1.12.0

dirrao avatar May 26 '24 15:05 dirrao

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[bot] avatar Jul 12 '24 00:07 github-actions[bot]

@dirrao - are you continuing with that :) ?

potiuk avatar Jul 12 '24 06:07 potiuk

@dirrao - are you continuing with that :) ?

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

dirrao avatar Jul 12 '24 08:07 dirrao

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

dirrao avatar Jul 29 '24 03:07 dirrao

@uranusjr Can you help me on the failing check?

dirrao avatar Aug 01 '24 16:08 dirrao

@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

dirrao avatar Aug 03 '24 06:08 dirrao

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

uranusjr avatar Aug 05 '24 07:08 uranusjr

The partial issue looks similar to https://github.com/python/mypy/issues/17631

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

uranusjr avatar Aug 06 '24 05:08 uranusjr

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

uranusjr avatar Aug 06 '24 05:08 uranusjr

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

hauntsaninja avatar Oct 17 '24 07:10 hauntsaninja

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[bot] avatar Dec 05 '24 00:12 github-actions[bot]