| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
During an import cycle, create_getattr_var can observe __getattr__'s signature before it has been analyzed: the return type is still an UnboundType, which then leaks to the importer as an invalid placeholder type instead of Any. Fall back to Any for unanalyzed return types, consistent with the existing non-callable fallback in the same function.
|
Diff from mypy_primer, showing the effect of this PR on open source code: prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/logging/filters.py:99: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/_internal/_logging.py:24: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/_internal/schemas/validators.py:681: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/_internal/schemas/validators.py:684: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/utilities/services.py:180: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/task_queue.py:21: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/task_queue.py:23: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/utilities/database.py:779: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/utilities/messaging/__init__.py:176: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/utilities/messaging/__init__.py:207: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/utilities/messaging/__init__.py:218: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/utilities/messaging/__init__.py:232: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/schemas/actions.py:139: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/schemas/actions.py:173: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/dependencies.py:117: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/server.py:45: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/server.py:46: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/server.py:110: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/server.py:111: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/server.py:112: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/configuration.py:93: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/configuration.py:94: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/configuration.py:130: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/schemas/events.py:48: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/schemas/events.py:51: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/docker/docker_image.py:85: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/schemas/objects.py:985: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/schemas/objects.py:995: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/_internal/version_checking.py:140: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/_internal/version_checking.py:141: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/schemas/events.py:177: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/schemas/events.py:180: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:86: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:87: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:108: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:110: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:186: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/clients.py:189: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:107: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:108: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:142: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:144: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:264: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:265: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:300: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:387: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:445: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/clients.py:744: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:294: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:302: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:332: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:356: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:424: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:566: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:574: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:604: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:628: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:696: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:769: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:771: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/base.py:775: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/schemas/actions.py:156: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/schemas/actions.py:228: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/schemas/core.py:579: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/messaging.py:52: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:143: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:144: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:146: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:252: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:474: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/configurations.py:572: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:55: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:57: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:62: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:67: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:168: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/events/worker.py:169: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:245: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:266: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:267: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:274: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:275: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:406: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:413: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:442: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:443: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:444: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:445: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:454: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1193: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1349: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1356: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1369: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1370: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1371: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1372: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/orchestration/__init__.py:1381: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/jinja_filters.py:65: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:71: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:72: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:73: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:78: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:87: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:101: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:102: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:103: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:183: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:265: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:266: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:321: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:324: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:386: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/logging/handlers.py:387: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/deployments/runner.py:1547: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/deployments/runner.py:1720: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/deployments/runner.py:1788: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/deployments/runner.py:1961: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:354: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:360: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:1157: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:1538: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:1622: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/flows.py:3227: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/database/dependencies.py:85: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/utilities/engine/__init__.py:856: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/services/telemetry.py:113: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/events.py:38: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/deployments.py:832: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/deployments.py:835: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/deployments.py:841: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/deployments.py:844: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/flow_runs.py:694: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/models/flow_runs.py:695: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/triggers.py:698: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/events/storage/database.py:209: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/task_engine.py:975: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/task_engine.py:1613: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:404: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:568: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:781: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:794: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:798: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:808: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:1035: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/server.py:1143: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/runner.py:455: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runner/runner.py:654: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/csrf_token.py:27: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runtime/flow_run.py:323: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/runtime/flow_run.py:330: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/cloud.py:53: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/cloud.py:63: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/cloud.py:89: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/client/cloud.py:134: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/events.py:112: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/events.py:125: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/concurrency_limits.py:509: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/server/api/concurrency_limits.py:532: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/workers/base.py:678: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/workers/base.py:681: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/workers/base.py:853: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/workers/base.py:892: error: Setting? has no attribute "value" [attr-defined]
- src/prefect/workers/base.py:1449: error: Setting? has no attribute "value" [attr-defined]
ibis (https://github.com/ibis-project/ibis)
- ibis/config.py:187: error: Any? has no attribute "connect" [attr-defined]
- ibis/backends/__init__.py:1743: error: Any? has no attribute "connect" [attr-defined]
- ibis/backends/__init__.py:1745: error: Any? has no attribute "connect" [attr-defined]
- ibis/backends/__init__.py:1748: error: Any? has no attribute "connect" [attr-defined]
- ibis/backends/__init__.py:1753: error: Any? has no attribute "connect" [attr-defined]
- ibis/backends/sql/compilers/bigquery/udf/core.py:607: error: Any? has no attribute "compile" [attr-defined]
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
During an import cycle, create_getattr_var can observe the module __getattr__'s signature before it has been analyzed: the return type is still an unanalyzed UnboundType (e.g. Incomplete from _typeshed), which then leaks to the importer as an invalid placeholder type (Bweh?) and triggers a spurious valid-type error, instead of resolving to Any.
Fall back to Any when the return type is unanalyzed, consistent with the existing non-callable fallback in the same function.
Fixes #22115
Test Plan
Added testModuleLevelGetattrImportCycle to check-modules.test (fails without the change, passes with it); the existing ModuleLevelGetattr family, cycle-related tests, and the full check-modules + check-newsemanal suites (508 tests) all pass.