Example with latest pyarrow:
>>>importpyarrowaspa>>>pa.__version__Out[30]: '15.0.0.dev436+gac50918a6.d20240117'>>>importpyarrow.computeaspc>>>arr=pa.array([pa.MonthDayNano((1, 1, 1)), pa.MonthDayNano((2, 2, 2))])
>>>arr<pyarrow.lib.MonthDayNanoIntervalArrayobjectat0x7f8e89147220>
[
1M1d1ns,
2M2d2ns
]
>>>pc.filter(arr, pa.array([True, False]))
Out[36]: <pyarrow.lib.MonthDayNanoIntervalArrayobjectat0x7f8e89e24580>
[
3M0d0ns# <-- this value didn't even exist in the original array
]
>>>arr=pa.array([pa.MonthDayNano((1, 1, 1)), None])
>>>arr<pyarrow.lib.MonthDayNanoIntervalArrayobjectat0x7f8e89e24820>
[
1M1d1ns,
null
]
>>>pc.filter(arr, pa.array([True, False]))
<pyarrow.lib.MonthDayNanoIntervalArrayobjectat0x7f8e88e4eda0>
[
null# <-- this should have selected the first element of the array, but returning null instead
]
Example with latest pyarrow: