jorisvandenbossche commented on PR #55264: URL: https://github.com/apache/arrow/pull/55264#issuecomment-6681135170
> * NumPy is also an optional dependency (next to pandas) so I added `# type: ignore[..]` there too. > Locally mypy and pyright both pass with only `# type: ignore[..]` so I removed pyright ignores > > * ty doesn't honor mypy's `# type: ignore[...]` and `# ty: ignore[unresolved-import]` fails if numpy/pandas are installed, so I disabled ty unresolved-import in pyproject.toml instead (mypy and pyright still catch broken imports). Alternatively, could we ensure those optional dependencies are installed whenever doing type checks? (which is already the case in practice?) That avoids having to add such ignores? > * I propose to use `typing_extensions.CapsuleType` instead of `Any` in `__arrow_c_schema__`. > Claude added a test for this case, I have reviewed and changed it a bit. `typing_extensions` dependency had to be added. > Note: we should leave the Protocols in `_stubs_typing.pyi` at `Any`. Polars' public `pl.DataFrame` and `pl.Series`, for example, annotate `__arrow_c_stream__ -> object` so narrowing the Protocol would reject them Would be good to add a test for that (so we don't accidentally change that to Capsule later) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
