Skip to content

Conversation

@rohanjain101
Copy link
Contributor

@rohanjain101 rohanjain101 commented Jan 20, 2024

a = pd.Series([7], dtype="uint8[pyarrow]")
b = pd.Series([-4], dtype="int8[pyarrow]")
a // b
pyarrow.lib.ArrowInvalid: Integer value -2 not in range: 0 to 255

But it works with numpy types:

a = pd.Series([7], dtype="uint8")
b = pd.Series([-4], dtype="int8")
a // b
0 -2
dtype: int16

@WillAyd WillAyd added the Arrow pyarrow functionality label Jan 21, 2024
@WillAyd
Copy link
Member

WillAyd commented Jan 21, 2024

Thanks for the PR but I am -1 to doing this. The pyarrow result makes sense given it follows usual C implicit type promotion rules but with added safety

I don't think we should try to make other libraries adhere to the NumPy type promotion rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arrow pyarrow functionality

2 participants