Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Description
In [2]: In [1]: importpandasaspd ...: ...: importpyarrowaspa ...: ...: ...: ...: s=pd.Series([True, False, None]) ...: ...: s+TrueOut[2]: 02112NaNdtype: objectIn [3]: In [1]: importpandasaspd ...: ...: importpyarrowaspa ...: ...: ...: ...: s=pd.Series([True, False, None], dtype=pd.BooleanDtype()) ...: ...: s+TrueOut[3]: 0True1True2<NA>dtype: booleanIn [4]: In [1]: importpandasaspd ...: ...: importpyarrowaspa ...: ...: ...: ...: s=pd.Series([True, False, None], dtype=pd.ArrowDtype(pa.bool_())) ...: ...: s+True ... File~/pandas/core/arrays/arrow/array.py:1022, inArrowExtensionArray._evaluate_op_method(self, other, op, arrow_funcs) 1020result=pc_func(self._pa_array, other) 1021exceptpa.ArrowNotImplementedErroraserr: ->1022raiseTypeError(self._op_method_error_message(other_original, op)) fromerr1023returnself._from_pyarrow_array(result) TypeError: operation'add'notsupportedfordtype'bool[pyarrow]'withobjectoftype<class'bool'>In addition to consistency, which result is preferred? I could see Out[2] or raising being the sensible behavior
Metadata
Metadata
Assignees
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations