Skip to content

[BUG] Argument of type "tuple[slice]" cannot be assigned to parameter "idx" #143

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

Closed
AchmadFathoni opened this issue Jul 16, 2022 · 1 comment · Fixed by #152
Closed

[BUG] Argument of type "tuple[slice]" cannot be assigned to parameter "idx" #143

AchmadFathoni opened this issue Jul 16, 2022 · 1 comment · Fixed by #152

Comments

@AchmadFathoni
Copy link
Contributor

Describe the bug
False positive error warning when using iloc function.

To Reproduce
Using pyright on

import pandas as pd

df = pd.DataFrame({'Char': ['A', 'B', 'C'], 'Number': [1, 2, 3]})
df = df.iloc[0:2,]

produces

Argument of type "tuple[slice]" cannot be assigned to parameter "idx" of type "IndexType | MaskType | Tuple[IndexType | MaskType, IndexType | MaskType]" in function "__getitem__"    Type "tuple[slice]" cannot be assigned to type "IndexType | MaskType | Tuple[IndexType | MaskType, IndexType | MaskType]"      "tuple[slice]" is incompatible

Please complete the following information:

  • OS: ArchLinux
  • python 3.10.5
  • pyright 1.1.260
  • pandas-stub 1.4.3.220704
@AchmadFathoni AchmadFathoni changed the title [iloc] Argument of type "tuple[slice]" cannot be assigned to parameter "idx" [BUG] Argument of type "tuple[slice]" cannot be assigned to parameter "idx" Jul 16, 2022
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 17, 2022

Should add Tuple[slice] to _iLocIndexerFrame.__getitem__() here:

PR welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants