Skip to content

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

Closed
@AchmadFathoni

Description

@AchmadFathoni

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions