[ty] Conservative narrowing places optimization by ericmarkmartin · Pull Request #22734 · astral-sh/ruff (original) (raw)
mypy_primer results
Changes were detected when running on open source projects
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
str, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
str | list[str] | None, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
str | None, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
bool | None, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
str | list[str] | None, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, str] | list[str] | None, foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr | bool | dict[Unknown | str, Unknown | int] | None - src/integrations/prefect-docker/tests/test_containers.py:42:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_containers.py:55:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_containers.py:68:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_containers.py:81:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
str, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
str | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
str | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
bool, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
DockerHost | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
DockerRegistryCredentials | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:21:16: warning[possibly-missing-attribute] Attribute
idmay be missing on object of typeUnknown | list[Unknown] - src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected
bool, foundstr - src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected
DockerRegistryCredentials | None, foundstr - src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_images.py:31:16: warning[possibly-missing-attribute] Attribute
idmay be missing on object of typeUnknown | list[Unknown] - src/integrations/prefect-docker/tests/test_images.py:51:17: error[invalid-argument-type] Argument is incorrect: Expected
bool, foundstr - src/integrations/prefect-docker/tests/test_images.py:51:17: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-docker/tests/test_images.py:53:16: warning[possibly-missing-attribute] Attribute
idmay be missing on object of typeUnknown | list[Unknown] - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
str, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
str | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
str | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
bool, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
DockerRegistryCredentials | None, foundstr | bool - src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr | bool - src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:428:17: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundstr - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:20:13: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundNone - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:29:13: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundNone - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:38:13: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundNone - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:57:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:103:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:149:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:195:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:240:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:286:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_custom_objects.py:344:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py🔞9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py:38:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py:70:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py:92:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py:113:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_deployments.py:141:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:36:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:52:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:68:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:87:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:107:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:131:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_jobs.py:159:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:29:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:46:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:78:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:96:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:115:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:137:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"] - src/integrations/prefect-kubernetes/tests/test_pods.py:167:9: error[invalid-argument-type] Argument is incorrect: Expected
dict[str, Any], foundLiteral["test"]
- src/prefect/cache_policies.py:311:25: warning[possibly-missing-attribute] Attribute
__code__may be missing on object of typeUnknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))
- src/prefect/cache_policies.py:311:25: warning[possibly-missing-attribute] Attribute
__code__may be missing on object of typeUnknown | ((...) -> Any)
- src/prefect/input/run_input.py:672:20: error[invalid-return-type] Return type does not match returned value: expected
T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler], foundT@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler] | Coroutine[Any, Any, T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler]]
- src/prefect/input/run_input.py:672:20: error[invalid-return-type] Return type does not match returned value: expected
T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler], foundUnknown | Coroutine[Any, Any, Unknown] - src/prefect/task_engine.py:1641:28: error[invalid-await]
Unknown | R@AsyncTaskRunEngine | Coroutine[Any, Any, R@AsyncTaskRunEngine]is not awaitable - src/prefect/task_engine.py:1749:47: error[invalid-argument-type] Argument to function
nextis incorrect: ExpectedSupportsNext[Unknown], foundUnknown | R@run_generator_task_sync - src/prefect/task_engine.py:1762:25: warning[possibly-missing-attribute] Attribute
throwmay be missing on object of typeUnknown | R@run_generator_task_sync - src/prefect/task_engine.py:1808:48: warning[possibly-missing-attribute] Attribute
__anext__may be missing on object of typeUnknown | R@run_generator_task_async - src/prefect/task_engine.py:1820:29: warning[possibly-missing-attribute] Attribute
throwmay be missing on object of typeUnknown | R@run_generator_task_async
- src/prefect/tasks.py:185:9: warning[possibly-missing-attribute] Attribute
__code__may be missing on object of typeUnknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))
- src/prefect/tasks.py:185:9: warning[possibly-missing-attribute] Attribute
__code__may be missing on object of typeUnknown | ((...) -> Any)
- Found 5393 diagnostics
- Found 5461 diagnostics
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/build/wheel.py:99:20: error[no-matching-overload] No overload of bound method
__init__matches arguments
- Found 49 diagnostics
- Found 50 diagnostics
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/test_pandas.py:511:18: error[assert-type-unspellable-subtype] Type
booldoes not match asserted typeTypeIs[timedelta64[timedelta & ~NaTType & ~NAType] @ np_td]
- tests/test_pandas.py:511:18: error[assert-type-unspellable-subtype] Type
booldoes not match asserted typeTypeIs[timedelta64[timedelta] @ np_td]
- tests/test_pandas.py:516:22: error[assert-type-unspellable-subtype] Type
booldoes not match asserted typeTypeIs[str | bytes | date | ... omitted 9 union elements @ np_nat]
- tests/test_pandas.py:516:22: error[assert-type-unspellable-subtype] Type
booldoes not match asserted typeTypeIs[timedelta64[timedelta | int | None] @ np_nat]
Memory usage changes were detected when running on open source projects
flake8 (https://github.com/pycqa/flake8)
- TOTAL MEMORY USAGE: ~66MB
- TOTAL MEMORY USAGE: ~63MB
trio (https://github.com/python-trio/trio)
- TOTAL MEMORY USAGE: ~167MB
- TOTAL MEMORY USAGE: ~159MB
struct metadata = ~11MB
struct metadata = ~10MB
memo fields = ~108MB
memo fields = ~103MB
sphinx (https://github.com/sphinx-doc/sphinx)
- TOTAL MEMORY USAGE: ~301MB
- TOTAL MEMORY USAGE: ~287MB
memo fields = ~176MB
memo fields = ~167MB
prefect (https://github.com/PrefectHQ/prefect)
memo fields = ~424MB
memo fields = ~403MB