Skip to content

Conversation

@ibraheemdev
Copy link
Member

Summary

Resolves astral-sh/ty#1543.

@ibraheemdev ibraheemdev added ty Multi-file analysis & type inference ecosystem-analyzer labels Nov 14, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 14, 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 14, 2025

mypy_primer results

Changes were detected when running on open source projects
kopf (https://github.com/nolar/kopf)
- kopf/_cogs/clients/creating.py:21:5: error[invalid-assignment] Object of type `(RawBody & ~None) | dict[Unknown, Unknown]` is not assignable to `RawBody | None`
- kopf/_cogs/clients/creating.py:23:9: warning[possibly-missing-attribute] Attribute `setdefault` may be missing on object of type `RawBody | None`
- kopf/_cogs/clients/creating.py:25:9: warning[possibly-missing-attribute] Attribute `setdefault` may be missing on object of type `RawBody | None`
- kopf/_cogs/clients/creating.py:27:44: warning[possibly-missing-attribute] Attribute `get` may be missing on object of type `RawBody | None`
- Found 64 diagnostics
+ Found 60 diagnostics

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/cargo/manifest.py:304:16: error[missing-typed-dict-key] Missing required key 'workspace' in TypedDict `FromWorkspace` constructor
+ mesonbuild/cargo/manifest.py:304:17: error[invalid-key] Invalid key for TypedDict `FromWorkspace`: Unknown key "version"
- Found 1726 diagnostics
+ Found 1728 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/plugins/worksearch/code.py:446:21: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 944 diagnostics
+ Found 945 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/structured_configs/_implementations.py:3506:9: error[invalid-assignment] Object of type `@Todo | dict[Unknown, Unknown]` is not assignable to `DataclassOptions`
- Found 548 diagnostics
+ Found 547 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/deploy/_core.py:246:63: error[invalid-argument-type] Argument to function `_generate_actions_for_remote_flow_storage` is incorrect: Expected `list[dict[str, Any]]`, found `(dict[str, Any] & ~AlwaysFalsy) | dict[Unknown, Unknown]`
+ src/prefect/cli/deploy/_core.py:246:63: error[invalid-argument-type] Argument to function `_generate_actions_for_remote_flow_storage` is incorrect: Expected `list[dict[str, Any]]`, found `dict[str, Any]`
- src/prefect/cli/deploy/_core.py:266:13: error[invalid-argument-type] Argument to function `_generate_default_pull_action` is incorrect: Expected `list[dict[str, Any]]`, found `(dict[str, Any] & ~AlwaysFalsy) | dict[Unknown, Unknown] | dict[str, list[dict[str, Any]]]`
+ src/prefect/cli/deploy/_core.py:266:13: error[invalid-argument-type] Argument to function `_generate_default_pull_action` is incorrect: Expected `list[dict[str, Any]]`, found `dict[str, Any] | dict[str, list[dict[str, Any]]]`

altair (https://github.com/vega/altair)
- altair/datasets/_reader.py:177:9: error[invalid-assignment] Object of type `(Metadata & Top[Mapping[Unknown, object]]) | (Path & Top[Mapping[Unknown, object]]) | (str & Top[Mapping[Unknown, object]]) | dict[Unknown | str, Unknown]` is not assignable to `Metadata | Path | str`
- altair/datasets/_reader.py:178:28: error[invalid-argument-type] Argument to bound method `_solve` is incorrect: Expected `Metadata`, found `Metadata | Path | str`
+ altair/datasets/_reader.py:178:28: error[invalid-argument-type] Argument to bound method `_solve` is incorrect: Expected `Metadata`, found `Metadata | (Path & Top[Mapping[Unknown, object]]) | (str & Top[Mapping[Unknown, object]])`
- Found 1020 diagnostics
+ Found 1019 diagnostics

streamlit (https://github.com/streamlit/streamlit)
- lib/streamlit/elements/widgets/data_editor.py:144:9: error[invalid-assignment] Object of type `dict[Unknown | str, Unknown | dict[Unknown, Unknown] | list[Unknown]] | Any` is not assignable to `EditingState`
- Found 138 diagnostics
+ Found 137 diagnostics

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/resources.py:316:9: error[invalid-assignment] Object of type `list[Literal["bokeh", "bokeh-gl", "bokeh-widgets", "bokeh-tables", "bokeh-mathjax", "bokeh-api"]] | list[str]` is not assignable to attribute `components` of type `list[Literal["bokeh", "bokeh-gl", "bokeh-widgets", "bokeh-tables", "bokeh-mathjax", "bokeh-api"]]`
- Found 645 diagnostics
+ Found 644 diagnostics

rotki (https://github.com/rotki/rotki)
- rotkehlchen/db/upgrades/v45_v46.py:121:25: error[invalid-argument-type] Argument to function `maybe_set_transaction_extra_data` is incorrect: Expected `AssetMovementExtraData | None`, found `dict[Unknown | str, Unknown] | None`
- rotkehlchen/exchanges/coinbase.py:1063:21: error[invalid-argument-type] Argument to function `maybe_set_transaction_extra_data` is incorrect: Expected `AssetMovementExtraData | None`, found `dict[Unknown | str, Unknown] | None`
- Found 2137 diagnostics
+ Found 2135 diagnostics

No memory usage changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 14, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 0 2 3
invalid-assignment 0 5 0
possibly-missing-attribute 0 3 0
invalid-key 1 0 0
missing-typed-dict-key 1 0 0
Total 2 10 3

Full report with detailed diff (timing results)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Lovely

@ibraheemdev ibraheemdev merged commit ffb7bdd into main Nov 14, 2025
43 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/conditional-expr-tcx branch November 14, 2025 20:19
dcreager added a commit that referenced this pull request Nov 14, 2025
* origin/main: (59 commits)
  [ty] Improve diagnostic range for `non-subscriptable` diagnostics (#21461)
  [ty] Improve literal promotion heuristics (#21439)
  [ty] Further improve details around which expressions should be deferred in stub files (#21456)
  [ty] Improve generic class constructor inference (#21442)
  [ty] Propagate type context through conditional expressions (#21443)
  [ty] Suppress completions when introducing names with `as`
  [ty] Add panic-by-default await methods to `TestServer` (#21451)
  [ty] name is parameter and global is a syntax error (#21312)
  [ty] Fixup a few details around version-specific dataclass features (#21453)
  [ty] Support attribute-expression `TYPE_CHECKING` conditionals (#21449)
  [ty] Support stringified annotations in value-position `Annotated` instances (#21447)
  [ty] Type inference for genererator expressions (#21437)
  [ty] Make `__getattr__` available for `ModuleType` instances (#21450)
  [ty] Increase default receive timeout in tests to 10s (#21448)
  [ty] Add synthetic members to completions on dataclasses (#21446)
  [ty] Support legacy `typing` special forms in implicit type aliases (#21433)
  Bump 0.14.5 (#21435)
  [ty] Support `type[…]` and `Type[…]` in implicit type aliases (#21421)
  [ty] Respect notebook cell boundaries when adding an auto import (#21322)
  Update PyCharm setup instructions (#21409)
  ...
dcreager added a commit that referenced this pull request Nov 14, 2025
* dcreager/deep-comparison: (64 commits)
  assuming
  SubtypingAssuming
  implies_subtype_of
  name tweak
  Apply suggestions from code review
  [ty] Improve diagnostic range for `non-subscriptable` diagnostics (#21461)
  [ty] Improve literal promotion heuristics (#21439)
  [ty] Further improve details around which expressions should be deferred in stub files (#21456)
  [ty] Improve generic class constructor inference (#21442)
  [ty] Propagate type context through conditional expressions (#21443)
  [ty] Suppress completions when introducing names with `as`
  [ty] Add panic-by-default await methods to `TestServer` (#21451)
  [ty] name is parameter and global is a syntax error (#21312)
  [ty] Fixup a few details around version-specific dataclass features (#21453)
  [ty] Support attribute-expression `TYPE_CHECKING` conditionals (#21449)
  [ty] Support stringified annotations in value-position `Annotated` instances (#21447)
  [ty] Type inference for genererator expressions (#21437)
  [ty] Make `__getattr__` available for `ModuleType` instances (#21450)
  [ty] Increase default receive timeout in tests to 10s (#21448)
  [ty] Add synthetic members to completions on dataclasses (#21446)
  ...
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.

Type context should be propagated through conditional expressions

3 participants