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
Replace Hashable with slice | _IndexSliceTuple | Callable
If you make the suggested change, that will cause the test test_frame.py:test_loc_slice() to fail, but I now realize that the expression used there is ambiguous:
From discussion in #575
In
pandas-stubs/pandas-stubs/core/frame.pyi
Line 163 in 41fe0f5
Replace
Hashable
withslice | _IndexSliceTuple | Callable
If you make the suggested change, that will cause the test
test_frame.py:test_loc_slice()
to fail, but I now realize that the expression used there is ambiguous:So the first argument as an integer could return a
DataFrame
orSeries
, dependent on whether the underlying index is a regularIndex
orMultiIndex
The solution is then to add another overload in
_LocIndexerFrame.__getitem__()
:Then modify the test in
test_index_slice()
to check that the type isUnion[pd.Series, pd.DataFrame]
, and add another test corresponding todf2
above.Originally posted by @Dr-Irv in #575 (comment)
The text was updated successfully, but these errors were encountered: