Skip to content

ci(typing): Disable mypy [annotation-unchecked] on examples#3775

Merged
dangotbanned merged 1 commit intomainfrom
mypy-ignore-example-unchecked
Jan 18, 2025
Merged

ci(typing): Disable mypy [annotation-unchecked] on examples#3775
dangotbanned merged 1 commit intomainfrom
mypy-ignore-example-unchecked

Conversation

@dangotbanned
Copy link
Copy Markdown
Member

@dangotbanned dangotbanned commented Jan 18, 2025

Disables the non-blocking warning that appeared since (1d01fa0)

tests\examples_methods_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests\examples_arguments_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]

I don't consider this useful because:

  1. The signature annotations were removed deliberately.
    Prior to this, they already did the dance of making the stubs of pandas, numpy and scipy happy.
  2. The default of mypy is the opposite of (pyright|pylance).
    I'm not planning to enable --check-untyped-defs - but I do want to avoid having warnings in VSCode.
  3. Annotations within examples are helpful for getting the correct completions, in cases where inference fails.
    This is why pd.Series[float] was added - to resolve pandas complex indexing @overload(s)

Disables the non-blocking warning that appeared since (1d01fa0)

https://github.com/vega/altair/actions/runs/12843721674/job/35815966648?pr=3747#step:8:13

> tests\examples_methods_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
> tests\examples_arguments_syntax\deviation_ellipses.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

I don't consider this useful because:
1. The signature annotations were removed deliberately. Prior to this, they already did the dance of making the stubs of `pandas`, `numpy` and `scipy` happy.
2. The default of `mypy` is the opposite of ((`pyright`|`pylance`))[https://microsoft.github.io/pyright/#/mypy-comparison?id=type-checking-unannotated-code]. I'm not planning to enable `--check-untyped-defs` - but I do want to avoid having warnings in VSCode.
3. Annotations within examples are helpful for getting the correct completions, in cases where inference fails. This is why `pd.Series[float]` was added - to resolve `pandas` complex indexing `@overload`(s)
@dangotbanned dangotbanned changed the title ci(typing): Disable mypy code [annotation-unchecked] on examples ci(typing): Disable mypy [annotation-unchecked] on examples Jan 18, 2025
@dangotbanned dangotbanned enabled auto-merge (squash) January 18, 2025 13:00
@dangotbanned dangotbanned merged commit a79b934 into main Jan 18, 2025
@dangotbanned dangotbanned deleted the mypy-ignore-example-unchecked branch January 18, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant