-
-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
ConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Description
Describe the bug
BooleanArray
does not support bitwise operations in the stubs, which works at runtime.
To Reproduce
Script
from typing import cast, reveal_type
import pandas as pd
from pandas.core.arrays.boolean import BooleanArray
a = pd.array([True], dtype="boolean")
reveal_type(a) # IntegerArray, runtime: BooleanArray
a = cast(BooleanArray, a)
_ = a & a # pyright gives reportOperatorIssue
Typechecker
pyright
Error messages
ttest.py:8:13 - information: Type of "a" is "IntegerArray"
ttest.py:11:5 - error: Operator "&" not supported for types "BooleanArray" and "BooleanArray" (reportOperatorIssue)
Information
- version of type checker:
1.1.406
- version of installed
pandas-stubs
:main
Metadata
Metadata
Assignees
Labels
ConstructorsSeries/DataFrame/Index/pd.array ConstructorsSeries/DataFrame/Index/pd.array ConstructorsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations