Skip to content

chore(typing): Widen _utils signatures #2712

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Jun 21, 2025

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

With that, I noticed a few others that also didn't need all the features of Sequence.

For reference, this section of the stubs is probably handy when trying to decide which Protocol to use
https://github.com/python/typeshed/blob/b98b6c376bb8d1443108c42c766e3de199328d32/stdlib/typing.pyi#L619-L643

In light of (#2706 (comment))

Splitting out a change from https://github.com/narwhals-dev/narwhals/blob/7bb0d0df3d2f75bc903aa9fc2abf0ecc5a61f432/narwhals/_utils.py#L1194

With that, I noticed a few others that also didn't need all the features of `Sequence`
The type here is dependent on `check_columns_exist`
See #2495 (comment)
`list[str] | _1DArray` is assignable to `Collection[str]`
Previously, failed on `Sequence[str]` due to `numpy`
@dangotbanned
Copy link
Member Author

dangotbanned commented Jun 21, 2025

Hmm, not sure why downstream is trying to install a numpy pre-release suddenly?

Using CPython 3.12.11 interpreter at: /opt/hostedtoolcache/Python/3.12.11/x64/bin/python3
Creating virtual environment at: .venv
error: Distribution `numpy==2.3.1 @ registry+[https://pypi.org/simple`](https://pypi.org/simple%60) can't be installed because it doesn't have a source distribution or wheel for the current platform

hint: You're using CPython 3.12 (`cp312`), but `numpy` (v2.3.1) only has wheels with the following Python ABI tag: `cp311`
make: *** [Makefile:5: test] Error 2
Error: Process completed with exit code 2.

Edit

Ahh the same appeared on main

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