tadeja commented on code in PR #55792:
URL: https://github.com/apache/arrow/pull/55792#discussion_r4739181283
##########
python/pyarrow-stubs/__lib/array.pyi:
##########
@@ -117,7 +126,10 @@ class ArrayStatistics(_Weakrefable):
@property
def is_max_exact(self) -> bool | None: ...
-class _PandasConvertible(_Weakrefable):
+# to_pandas() arrays return Series, tables return DataFrame
+_PandasT = TypeVar("_PandasT", pd.Series[Any], pd.DataFrame)
Review Comment:
Well, there's actually no difference for type checkers (today:) and I
thought explicit `[Any]` would be good for clarity but I've reconsidered and
removed it so it's less unusual and matches our other uses of `pd.Series`.
Note (for myself) --> pandas-stubs defines `Series`'s type parameter with
`default=Any` ( [see their
_typing.pyi](https://github.com/pandas-dev/pandas-stubs/blame/2065c45ca15bc08bace42142210b35ebbf0448b6/pandas-stubs/_typing.pyi#L1071)
and
[philosophy.md](https://github.com/pandas-dev/pandas-stubs/blob/e3600d3514ca0f97b51d81bffde1047353ab590f/docs/philosophy.md)
), so bare `pd.Series` and `pd.Series[Any]` are equivalent. Also for `mypy
--strict`.
--
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]