Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Nov 22, 2025

Summary

Implement from x.y import z ensuring x.y resolves in the current file if a y attribute isn't otherwise available on x. This is implemented by adding these kinds of imports to available_submodule_attributes and lowering the priority of available_submodule_attributes.

Keeping the priority low ensures that things like from .y import y in an __init__.py reliable exposes the function/class y and not the submodule y (an extremely common idiom).

Fixes astral-sh/ty#1654

Test Plan

Snapshot tests.

@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Nov 22, 2025
@AlexWaygood AlexWaygood force-pushed the alex/submodule-attr-last branch from 3e0996f to bb12b0d Compare November 22, 2025 23:22
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 22, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 22, 2025

mypy_primer results

Changes were detected when running on open source projects
bandersnatch (https://github.com/pypa/bandersnatch)
- src/bandersnatch/tests/test_verify.py:169:25: warning[possibly-missing-attribute] Submodule `verify` may not be available as an attribute on module `bandersnatch`
- src/bandersnatch/tests/test_verify.py:237:25: warning[possibly-missing-attribute] Submodule `verify` may not be available as an attribute on module `bandersnatch`
- src/bandersnatch/tests/test_verify.py:238:25: warning[possibly-missing-attribute] Submodule `verify` may not be available as an attribute on module `bandersnatch`
- Found 80 diagnostics
+ Found 77 diagnostics

beartype (https://github.com/beartype/beartype)
- beartype/door/_cls/doormeta.py:82:10: error[unresolved-attribute] Object of type `object` has no attribute `TypeHint`
- beartype/door/_cls/doormeta.py:163:19: error[unresolved-attribute] Object of type `object` has no attribute `TypeHint`
+ beartype/door/_cls/doormeta.py:163:45: error[invalid-assignment] Object of type `object` is not assignable to `TypeHint[Unknown]`
- beartype/door/_cls/doormeta.py:179:10: error[unresolved-attribute] Object of type `object` has no attribute `TypeHint`
- Found 507 diagnostics
+ Found 505 diagnostics

pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/fixtures.py:144:31: warning[possibly-missing-attribute] Submodule `main` may not be available as an attribute on module `_pytest`
- src/_pytest/python.py:1692:20: warning[possibly-missing-attribute] Submodule `_code` may not be available as an attribute on module `_pytest`
- testing/test_assertrewrite.py:2084:13: warning[possibly-missing-attribute] Submodule `assertion` may not be available as an attribute on module `_pytest`
- testing/test_assertrewrite.py:2111:13: warning[possibly-missing-attribute] Submodule `assertion` may not be available as an attribute on module `_pytest`
- testing/test_config.py:2313:30: warning[possibly-missing-attribute] Submodule `config` may not be available as an attribute on module `_pytest`
- testing/test_config.py:2496:18: warning[possibly-missing-attribute] Submodule `config` may not be available as an attribute on module `_pytest`
- testing/test_config.py:2497:21: warning[possibly-missing-attribute] Submodule `config` may not be available as an attribute on module `_pytest`
- Found 457 diagnostics
+ Found 450 diagnostics

scrapy (https://github.com/scrapy/scrapy)
- tests/test_commands.py:46:59: warning[possibly-missing-attribute] Submodule `settings` may not be available as an attribute on module `scrapy`
- tests/test_feedexport.py:1348:29: warning[possibly-missing-attribute] Submodule `extensions` may not be available as an attribute on module `scrapy`
- tests/test_feedexport.py:1352:29: warning[possibly-missing-attribute] Submodule `extensions` may not be available as an attribute on module `scrapy`
- Found 1739 diagnostics
+ Found 1736 diagnostics

porcupine (https://github.com/Akuli/porcupine)
- porcupine/settings.py:732:72: warning[possibly-missing-attribute] Submodule `ttk` may not be available as an attribute on module `tkinter`
- Found 17 diagnostics
+ Found 16 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
- github/AuthenticatedUser.py:609:16: warning[possibly-missing-attribute] Submodule `Project` may not be available as an attribute on module `github`
- github/AuthenticatedUser.py:774:41: warning[possibly-missing-attribute] Submodule `Label` may not be available as an attribute on module `github`
- github/AuthenticatedUser.py:807:41: warning[possibly-missing-attribute] Submodule `Label` may not be available as an attribute on module `github`
- github/AuthenticatedUser.py:955:30: warning[possibly-missing-attribute] Submodule `Team` may not be available as an attribute on module `github`
- github/AuthenticatedUser.py:968:13: warning[possibly-missing-attribute] Submodule `Installation` may not be available as an attribute on module `github`
- github/Branch.py:100:43: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/Branch.py:101:38: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/Branch.py:103:44: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/Branch.py:105:48: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/Branch.py:500:16: warning[possibly-missing-attribute] Submodule `PaginatedList` may not be available as an attribute on module `github`
- github/Branch.py:501:13: warning[possibly-missing-attribute] Submodule `NamedUser` may not be available as an attribute on module `github`
- github/Branch.py:511:16: warning[possibly-missing-attribute] Submodule `PaginatedList` may not be available as an attribute on module `github`
- github/Branch.py:512:13: warning[possibly-missing-attribute] Submodule `Team` may not be available as an attribute on module `github`
- github/BranchProtection.py:176:16: warning[possibly-missing-attribute] Submodule `PaginatedList` may not be available as an attribute on module `github`
- github/Commit.py:289:13: warning[possibly-missing-attribute] Submodule `PullRequest` may not be available as an attribute on module `github`
- github/CommitComment.py:191:13: warning[possibly-missing-attribute] Submodule `Reaction` may not be available as an attribute on module `github`
- github/CommitComment.py:213:16: warning[possibly-missing-attribute] Submodule `Reaction` may not be available as an attribute on module `github`
- github/GistHistoryState.py:207:69: warning[possibly-missing-attribute] Submodule `GistFile` may not be available as an attribute on module `github`
- github/GitRelease.py:384:16: warning[possibly-missing-attribute] Submodule `PaginatedList` may not be available as an attribute on module `github`
- github/IssueComment.py:194:13: warning[possibly-missing-attribute] Submodule `Reaction` may not be available as an attribute on module `github`
- github/IssueComment.py:216:16: warning[possibly-missing-attribute] Submodule `Reaction` may not be available as an attribute on module `github`
- github/MainClass.py:447:16: warning[possibly-missing-attribute] Submodule `Organization` may not be available as an attribute on module `github`
- github/MainClass.py:458:13: warning[possibly-missing-attribute] Submodule `Organization` may not be available as an attribute on module `github`
- github/MainClass.py:489:16: warning[possibly-missing-attribute] Submodule `Repository` may not be available as an attribute on module `github`
- github/MainClass.py:509:13: warning[possibly-missing-attribute] Submodule `Repository` may not be available as an attribute on module `github`
- github/MainClass.py:517:49: warning[possibly-missing-attribute] Submodule `RepositoryDiscussion` may not be available as an attribute on module `github`
- github/MainClass.py:525:16: warning[possibly-missing-attribute] Submodule `Project` may not be available as an attribute on module `github`
- github/MainClass.py:536:16: warning[possibly-missing-attribute] Submodule `ProjectColumn` may not be available as an attribute on module `github`
- github/MainClass.py:606:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:607:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:608:26: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:609:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:610:28: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:611:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:612:32: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:613:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:614:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:615:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:616:28: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:617:26: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:618:25: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:619:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:620:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:623:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:626:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:628:26: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:632:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:634:28: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:637:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:641:32: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:643:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:647:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:649:27: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:651:28: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:653:26: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:655:25: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:657:24: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:660:29: warning[possibly-missing-attribute] Submodule `GithubObject` may not be available as an attribute on module `github`
- github/MainClass.py:663:16: warning[possibly-missing-attribute] Submodule `PaginatedList` may not be available as an attribute on module `github`
- github/MainClass.py:704:13: warning[possibly-missing-attribute] Submodule `Repository` may not be available as an attribute on module `github`
- github/MainClass.py:826:13: warning[possibly-missing-attribute] Submodule `ContentFile` may not be available as an attribute on module `github`
- github/MainClass.py:911:57: warning[possibly-missing-attribute] Submodule `Repository` may not be available as an attribute on module `github`
- github/NamedUser.py:469:51: warning[possibly-missing-attribute] Submodule `UserKey` may not be available as an attribute on module `github`
- github/NamedUser.py:486:13: warning[possibly-missing-attribute] Submodule `Project` may not be available as an attribute on module `github`
- github/NamedUser.py:598:16: warning[possibly-missing-attribute] Submodule `Membership` may not be available as an attribute on module `github`
- github/Organization.py:756:16: warning[possibly-missing-attribute] Submodule `Hook` may not be available as an attribute on module `github`
- github/Organization.py:1156:16: warning[possibly-missing-attribute] Submodule `Hook` may not be available as an attribute on module `github`
- github/Organization.py:1165:36: warning[possibly-missing-attribute] Submodule `Hook` may not be available as an attribute on module `github`
- github/Organization.py:1171:16: warning[possibly-missing-attribute] Submodule `Hook` may not be available as an attribute on module `github`
- github/Organization.py:1177:30: warning[possibly-missing-attribute] Submodule `Hook` may not be available as an attribute on module `github`
- github/Organization.py:1229:41: warning[possibly-missing-attribute] Submodule `Label` may not be available as an attribute on module `github`
- github/Organization.py:1240:30: warning[possibly-missing-attribute] Submodule `Issue` may not be available as an attribute on module `github`
- github/Organization.py:1333:16: warning[possibly-missing-attribute] Submodule `PublicKey` may not be available as an attribute on module `github`
- github/Organization.py:1543:16: warning[possibly-missing-attribute] Submodule `Migration` may not be available as an attribute on module `github`
- github/Organization.py:1551:13: warning[possibly-missing-attribute] Submodule `Migration` may not be available as an attribute on module `github`
- github/Organization.py:1565:13: warning[possibly-missing-attribute] Submodule `Installation` may not be available as an attribute on module `github`
- github/PullRequest.py:454:16: warning[possibly-missing-attribute] Submodule `Issue` may not be available as an attribute on module `github`
- github/RepositoryDiscussionCategory.py:137:17: warning[possibly-missing-attribute] Submodule `Repository` may not be available as an attribute on module `github`
- github/RepositoryDiscussionComment.py:135:17: warning[possibly-missing-attribute] Submodule `RepositoryDiscussion` may not be available as an attribute on module `github`
- github/Team.py:322:16: warning[possibly-missing-attribute] Submodule `Membership` may not be available as an attribute on module `github`
- github/WorkflowRun.py:320:13: warning[possibly-missing-attribute] Submodule `Artifact` may not be available as an attribute on module `github`
- tests/Requester.py:49:9: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:52:9: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:61:21: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:79:41: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:98:16: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:115:21: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:404:29: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:406:30: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:410:29: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:412:30: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:416:29: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- tests/Requester.py:418:30: warning[possibly-missing-attribute] Submodule `Requester` may not be available as an attribute on module `github`
- Found 288 diagnostics
+ Found 195 diagnostics

dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/faas_utest.py:30:29: warning[possibly-missing-attribute] Submodule `mock` may not be available as an attribute on module `unittest`
- Found 436 diagnostics
+ Found 435 diagnostics

urllib3 (https://github.com/urllib3/urllib3)
- test/contrib/emscripten/test_emscripten.py:913:23: warning[possibly-missing-attribute] Submodule `connection` may not be available as an attribute on module `urllib3`
- Found 332 diagnostics
+ Found 331 diagnostics

pandera (https://github.com/pandera-dev/pandera)
- pandera/api/pyspark/container.py:141:77: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ pandera/api/pyspark/container.py:43:28: warning[possibly-missing-attribute] Member `api` may be missing on module `pandera`
- pandera/api/pyspark/container.py:581:69: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- pandera/api/pyspark/container.py:599:65: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- pandera/api/pyspark/container.py:600:57: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- tests/dask/test_dask.py:111:27: warning[possibly-missing-attribute] Submodule `dask` may not be available as an attribute on module `pandera.typing`
- tests/dask/test_dask.py:114:28: warning[possibly-missing-attribute] Submodule `dask` may not be available as an attribute on module `pandera.typing`
+ tests/dask/test_dask.py:111:27: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `dask`
+ tests/dask/test_dask.py:114:28: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `dask`
- tests/fastapi/models.py:10:9: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:10:9: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/fastapi/models.py:11:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:11:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/fastapi/models.py:23:9: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:23:9: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/fastapi/models.py:24:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:24:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/fastapi/models.py:25:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:25:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/fastapi/models.py:48:9: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:48:9: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/io/test_pandas_io.py:1435:9: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1447:9: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1464:9: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1506:18: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1507:14: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1530:9: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1906:14: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:1987:14: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/io/test_pandas_io.py:2033:14: warning[possibly-missing-attribute] Submodule `io` may not be available as an attribute on module `pandera`
- tests/modin/test_schemas_on_modin.py:317:20: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:318:22: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:319:20: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:387:12: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:390:12: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:416:13: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:417:10: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:423:13: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
- tests/modin/test_schemas_on_modin.py:424:10: warning[possibly-missing-attribute] Submodule `modin` may not be available as an attribute on module `pandera.typing`
+ tests/modin/test_schemas_on_modin.py:317:20: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:318:22: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:319:20: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:387:12: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:390:12: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:416:13: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:417:10: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:423:13: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
+ tests/modin/test_schemas_on_modin.py:424:10: error[unresolved-attribute] Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`
- tests/mypy/pandas_modules/pandera_inheritance.py:8:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:8:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:9:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:9:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:10:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:10:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:14:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:14:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:15:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:15:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:16:8: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:16:8: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_types.py:7:16: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_types.py:7:16: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:258:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:258:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:259:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:259:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:293:18: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:293:18: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:303:14: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:303:14: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:16:14: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:16:14: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:17:14: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:17:14: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:73:16: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:73:16: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:212:16: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:212:16: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:276:16: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:276:16: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:276:50: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:276:50: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:281:13: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:281:13: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:282:10: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:282:10: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:225:23: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:225:23: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:1995:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:1995:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:1996:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:1996:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2014:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2014:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2015:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2015:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2033:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2033:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2034:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2034:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2057:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2057:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2058:15: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2058:15: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2157:20: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2157:20: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2159:13: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2159:13: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_multithreaded.py:11:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_multithreaded.py:11:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_parsers.py:169:16: warning[possibly-missing-attribute] Member `Index` may be missing on module `pandera.typing`
+ tests/pandas/test_parsers.py:169:16: warning[possibly-missing-attribute] Attribute `Index` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:32:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:32:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:33:13: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:33:13: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:34:13: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:34:13: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:41:18: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:41:18: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:16:16: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:16:16: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:16:47: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:16:47: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:38:15: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:38:15: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:39:10: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:39:10: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:108:23: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:108:23: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:109:16: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:109:16: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:114:16: warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:114:16: warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:21:17: warning[possibly-missing-attribute] Member `Bool` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:21:17: warning[possibly-missing-attribute] Attribute `Bool` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:25:17: warning[possibly-missing-attribute] Member `DateTime` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:25:17: warning[possibly-missing-attribute] Attribute `DateTime` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:29:17: warning[possibly-missing-attribute] Member `Category` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:29:17: warning[possibly-missing-attribute] Attribute `Category` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:33:17: warning[possibly-missing-attribute] Member `Float` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:33:17: warning[possibly-missing-attribute] Attribute `Float` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:37:17: warning[possibly-missing-attribute] Member `Float16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:37:17: warning[possibly-missing-attribute] Attribute `Float16` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:41:17: warning[possibly-missing-attribute] Member `Float32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:41:17: warning[possibly-missing-attribute] Attribute `Float32` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:45:17: warning[possibly-missing-attribute] Member `Float64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:45:17: warning[possibly-missing-attribute] Attribute `Float64` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:49:17: warning[possibly-missing-attribute] Member `Int` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:49:17: warning[possibly-missing-attribute] Attribute `Int` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:53:17: warning[possibly-missing-attribute] Member `Int8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:53:17: warning[possibly-missing-attribute] Attribute `Int8` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:57:17: warning[possibly-missing-attribute] Member `UInt8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:57:17: warning[possibly-missing-attribute] Attribute `UInt8` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:61:17: warning[possibly-missing-attribute] Member `Int16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:61:17: warning[possibly-missing-attribute] Attribute `Int16` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:65:17: warning[possibly-missing-attribute] Member `UInt16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:65:17: warning[possibly-missing-attribute] Attribute `UInt16` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:69:17: warning[possibly-missing-attribute] Member `Int32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:69:17: warning[possibly-missing-attribute] Attribute `Int32` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:73:17: warning[possibly-missing-attribute] Member `UInt32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:73:17: warning[possibly-missing-attribute] Attribute `UInt32` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:77:17: warning[possibly-missing-attribute] Member `Int64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:77:17: warning[possibly-missing-attribute] Attribute `Int64` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:81:17: warning[possibly-missing-attribute] Member `UInt64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:81:17: warning[possibly-missing-attribute] Attribute `UInt64` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:85:17: warning[possibly-missing-attribute] Member `Object` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:85:17: warning[possibly-missing-attribute] Attribute `Object` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:89:17: warning[possibly-missing-attribute] Member `String` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:89:17: warning[possibly-missing-attribute] Attribute `String` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:93:17: warning[possibly-missing-attribute] Member `Timedelta` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:93:17: warning[possibly-missing-attribute] Attribute `Timedelta` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:97:17: warning[possibly-missing-attribute] Member `INT8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:97:17: warning[possibly-missing-attribute] Attribute `INT8` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:101:17: warning[possibly-missing-attribute] Member `UINT8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:101:17: warning[possibly-missing-attribute] Attribute `UINT8` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:105:17: warning[possibly-missing-attribute] Member `INT16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:105:17: warning[possibly-missing-attribute] Attribute `INT16` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:109:17: warning[possibly-missing-attribute] Member `UINT16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:109:17: warning[possibly-missing-attribute] Attribute `UINT16` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:113:17: warning[possibly-missing-attribute] Member `INT32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:113:17: warning[possibly-missing-attribute] Attribute `INT32` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:117:17: warning[possibly-missing-attribute] Member `UINT32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:117:17: warning[possibly-missing-attribute] Attribute `UINT32` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:121:17: warning[possibly-missing-attribute] Member `INT64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:121:17: warning[possibly-missing-attribute] Attribute `INT64` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:125:17: warning[possibly-missing-attribute] Member `UINT64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:125:17: warning[possibly-missing-attribute] Attribute `UINT64` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/pyspark/test_pyspark_model.py:488:9: warning[possibly-missing-attribute] Submodule `errors` may not be available as an attribute on module `pandera`
- tests/strategies/test_strategies.py:959:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:959:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/strategies/test_strategies.py:960:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:960:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- tests/strategies/test_strategies.py:961:11: warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:961:11: warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `<module 'pandera.typing'> | <module 'pandera.typing'>`
- Found 1638 diagnostics
+ Found 1625 diagnostics

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/sourceline.py:17:30: error[invalid-argument-type] Argument to function `_add_lc_filename` is incorrect: Expected `CommentedBase`, found `object`
+ schema_salad/sourceline.py:20:30: error[invalid-argument-type] Argument to function `_add_lc_filename` is incorrect: Expected `CommentedBase`, found `object`
- schema_salad/sourceline.py:12:25: warning[possibly-missing-attribute] Submodule `comments` may not be available as an attribute on module `ruamel.yaml`
- schema_salad/sourceline.py:13:22: warning[possibly-missing-attribute] Submodule `comments` may not be available as an attribute on module `ruamel.yaml`
- schema_salad/sourceline.py:30:24: warning[possibly-missing-attribute] Submodule `comments` may not be available as an attribute on module `ruamel.yaml`
- schema_salad/sourceline.py:286:38: warning[possibly-missing-attribute] Submodule `comments` may not be available as an attribute on module `ruamel.yaml`
- schema_salad/tests/test_errors.py:302:24: warning[possibly-missing-attribute] Submodule `schema` may not be available as an attribute on module `schema_salad`
- schema_salad/tests/test_errors.py:323:20: warning[possibly-missing-attribute] Submod

... (truncated 714 lines) ...
Memory usage changes were detected when running on open source projects
trio (https://github.com/python-trio/trio)
- TOTAL MEMORY USAGE: ~159MB
+ TOTAL MEMORY USAGE: ~167MB
-     struct fields = ~11MB
+     struct fields = ~12MB

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 23, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
possibly-missing-attribute 218 379 126
unresolved-attribute 16 23 0
invalid-assignment 6 0 0
unused-ignore-comment 2 4 0
invalid-argument-type 3 0 0
unsupported-base 0 1 0
Total 245 407 126

Full report with detailed diff (timing results)

@AlexWaygood
Copy link
Member Author

everything's great as long as you don't scroll down to the bit of the primer diff where the prefect diagnostics are listed

@Gankra
Copy link
Contributor

Gankra commented Nov 23, 2025

Taking a look at the code, the errors on prefect seem completely legitimate? The file doesn't import it and the __init__.py's along the chain don't import it. These symbols being available must be genuine spooky-action-at-a-distance that we should probably discourage.

@AlexWaygood
Copy link
Member Author

Taking a look at the code, the errors on prefect seem completely legitimate? The file doesn't import it and the __init__.py's along the chain don't import it. These symbols being available must be genuine spooky-action-at-a-distance that we should probably discourage.

Yeah I agree, I'm not sure why we aren't emitting errors on this on main? There are other repos on which this branch does indeed produce false positives though, which I'm looking at now

@Gankra
Copy link
Contributor

Gankra commented Nov 23, 2025

Also did you ever try not-distinguishing-import-kind? i.e. even making import ... weak?

The synthesis of these two issues would be interested in it (but maybe we just use the kind machinery to represent that case anyway):

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Nov 23, 2025

Also did you ever try not-distinguishing-import-kind? i.e. even making import ... weak?

I did, but it directly contradicts some longstanding tests that were added in #14946 sooo... I got scared :P

I do think it makes sense that if a user has import a.b at the top of their module, they almost certainly expect the attribute a.b to resolve to the b submodule of the package a, whereas they won't necessarily expect the same thing for the a.b access if all they have in their module is from a.b import c... but it's also the case that in tie-breaking situations, we just don't know for sure which way the tie will actually be broken, and I don't know if it would be clear to users why we're distinguishing between the two kinds of imports.

The longstanding tests were also added before we added any kind of ecosystem check, so I do think it would be interesting to see the ecosystem effect from not-distinguishing-import-kind as well. I'd like to try it separately, after I've debugged some of the stranger diagnostics on this branch a bit more.

@AlexWaygood AlexWaygood force-pushed the alex/submodule-attr-last branch from 4d0ab1d to ba3d1ed Compare November 23, 2025 17:17
@AlexWaygood AlexWaygood force-pushed the alex/submodule-attr-last branch 3 times, most recently from 8edee57 to 9355fa9 Compare November 23, 2025 18:03
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Nov 23, 2025

I can't see any "obviously wrong" diagnostics in the ecosystem anymore among the added or changed diagnostics. Nearly all the new diagnostics are on prefect. As noted above, I'm not sure why these aren't emitted on main; they seem like true positives, as do all new diagnostics on other repos. This does get rid of diagnostics across the ecosystem overall now; it's just a question of whether this behaviour is explainable to users.

Still TODO is

@Gankra
Copy link
Contributor

Gankra commented Nov 26, 2025

Oh dear, rebasing + rerunning has even worse results than last time. Gotta look at what's goin' on...

@Gankra
Copy link
Contributor

Gankra commented Nov 26, 2025

prefect mystery solved: their __init__.py intentionally doesn't import anything and contains a __getattr__ that lazy-imports its submodules. We previously found this implementation out of desperation and concluded all submodule attributes resolved and were Any. Now that we resolve a lot of imports, we "dodge" the __getattr__ and have way less Any making everything resolve everywhere.

This is an acceptable regression.

@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

Ok well I can see why you had trouble reproducing the issue... THE ISSUE ONLY APPEARS IF THE CODE CONTAINS from typing import TYPE_CHECKING

YOU DON'T EVEN NEED TO USE IT.

WHAT.

@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

More precise statement after messing around with it: from typing import <anything that resolves> has this issue. Importing from other modules like typing_extensions or warnings has no effect.

@Gankra

This comment was marked as outdated.

@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

Note: split the uniformly-weak-submodule-attributes out to #21653

@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

scipy has the same magic lazy imports with __getattr__ thing that prefect does, although it comes up a lot less.

@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

- [warning] possibly-missing-attribute - Submodule `modin` may not be available as an attribute on module `pandera.typing`
+ [error] unresolved-attribute - Object of type `<module 'pandera.typing'> | <module 'pandera.typing'>` has no attribute `modin`

This is an unfortunate but kinda minor degradation (we could potentially add some diagnostic cleaning for it).

@Gankra Gankra marked this pull request as ready for review November 27, 2025 14:39
@Gankra
Copy link
Contributor

Gankra commented Nov 27, 2025

I think this is ready for review/discussion.

Copy link
Contributor

@Gankra Gankra left a comment

Choose a reason for hiding this comment

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

I guess I actually didn't end up changing the code itself, so, the code changes honestly look like what I'd expect.

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Nov 27, 2025

Thank you so much for picking this up, and in particular for experimenting with #21653 separately!

I'm surprised at how small the diff is on #21653 -- it's basically all pwndbg, which is doing very strange and unusual things with its submodule imports ("submodule imports Georg" should be excluded as an outlier, etc.). So I wonder if we should just adopt the rule proposed by #21653, where submodule attributes always have lower priority than symbols defined in the __init__.py module namespace? The attraction of that is that it's a much simpler rule to explain to users; it's not great to have to explain a subtle distinction where we treat a submodule attribute introduced by import a.b as having a higher priority than a submodule attribute introduced by from a.b import c.

As per #14946 (comment), that would mean that we'd be moving towards mypy's behaviour here and away from pyright's. But empirically, the ecosystem results appear to indicate that mypy's heuristic works better much more of the time than pyright's does.

I'm curious for what others think; don't make any changes here until other folks have had a chance to chime in 😅 The disadvantage of adopting the rule in #21653 is that you can get counterintuitive situations where things like this can happen:

import a.b

reveal_type(a.b)  # revealed: Literal[1]

But the ecosystem report suggests that situations like this are rare. And honestly, at some point you just have to say that libraries need to stop shadowing their submodules with variables in __init__.py if they want type checkers to understand this stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker.types reported as possibly-missing-attribute after import docker; from docker.types import Ulimit

3 participants