You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NDFrame.align is annotated as def align(self: NDFrameT, other: NDFrameT, ...) -> NDFrameT: but actually other does not need to match self and it usually returns a tuple[Self, type(other)]. The "usually" is because when broadcast_axis==1 and self.ndim != other.ndim it returns tuple[DataFrame, DataFrame] (xref #51856 id like to deprecate this special case).
I tried annotating this correctly and got 40ish complaints e.g pandas/core/generic.py:8994: error: Cannot determine type of "index" [has-type]
The text was updated successfully, but these errors were encountered:
When does align return a non-tuple? Both _align_frame and _align_series always return a tuple, so I don't see how align can return anything but a tuple.
NDFrame.align
is annotated asdef align(self: NDFrameT, other: NDFrameT, ...) -> NDFrameT:
but actuallyother
does not need to matchself
and it usually returns atuple[Self, type(other)]
. The "usually" is because whenbroadcast_axis==1 and self.ndim != other.ndim
it returnstuple[DataFrame, DataFrame]
(xref #51856 id like to deprecate this special case).I tried annotating this correctly and got 40ish complaints e.g
pandas/core/generic.py:8994: error: Cannot determine type of "index" [has-type]
The text was updated successfully, but these errors were encountered: