Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

dangotbanned
Copy link
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
28 checks passed
@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