Skip to content

Missing args callable #18990

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

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Conversation

Jdwashin9
Copy link

Fixes #18783

Updated suggested code from prototype and modified check_call_expr_with_callee_type so that all required named or positional arguments are supplied during constructor calls. Tests were also written to verify that missing arguments raise type-checking errors.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@lesliehuh
Copy link

lesliehuh commented Apr 30, 2025

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/pydantic/v2_validated_func.py:50: error: Argument after ** must be a mapping, not "Union[type[Any], dict[str, Any], None]"  [arg-type]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/excel/_xlsxwriter.py:259: error: Expected iterable as variadic argument  [misc]

antidote (https://github.com/Finistere/antidote)
+ src/antidote/core/_inject.py:348: error: Expected iterable as variadic argument  [misc]
+ src/antidote/core/_inject.py:348: error: Argument after ** must be a mapping, not "dict[str, Any] | None"  [arg-type]

xarray (https://github.com/pydata/xarray)
+ xarray/core/common.py: note: In member "squeeze" of class "DataWithCoords":
+ xarray/core/common.py:460: error: Keywords must be strings  [misc]
+ xarray/core/dataset.py: note: In member "_stack_once" of class "Dataset":
+ xarray/core/dataset.py:5085: error: Keywords must be strings  [misc]

pandera (https://github.com/pandera-dev/pandera)
+ tests/pandas/test_extensions.py:57: error: Argument after ** must be a mapping, not "object"  [arg-type]
+ tests/pandas/test_extensions.py:99: error: Argument after ** must be a mapping, not "object"  [arg-type]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/core/imports.py: note: In member "add_items" of class "Batch":
+ openlibrary/core/imports.py:131: error: Argument after ** must be a mapping, not "str | dict[Any, Any]"  [arg-type]

jax (https://github.com/google/jax)
+ jax/_src/numpy/einsum.py:566: error: Argument after ** must be a mapping, not "NamedSharding | None"  [arg-type]

@Jdwashin9
Copy link
Author

Jdwashin9 commented Apr 30, 2025

@sterliakov ready for your review, when you have time. Thanks again for assisting with the internal error issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect impossible unpacking?
2 participants