You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "MCRE-BE (via GitHub)" <gi...@apache.org> on 2024/06/12 12:03:57 UTC
[I] [PYTHON] pyarrow.compute.and_ and operator.and_ not equal [arrow]
MCRE-BE opened a new issue, #42119:
URL: https://github.com/apache/arrow/issues/42119
### Describe the usage question you have. Please include as many useful details as possible.
Maybe a dumb question, but I don't see why it doesn't work.
I need a way to create a dynamic filter based on input.
This code runs fine
```python
compute_expression = [pc.field(col).isin(d[col].unique().tolist()) for col in subset]
compute_expression = functools.reduce(operator.and_, compute_expression)
compute_expression = pc.invert(compute_expression)
temp = pd.read_parquet(file_name, filters=compute_expression)
```
The following code produces an error :
```python
compute_expression = [pc.field(col).isin(d[col].unique().tolist()) for col in subset]
compute_expression = functools.reduce(pc.and_, compute_expression)
compute_expression = pc.invert(compute_expression)
temp = pd.read_parquet(file_name, filters=compute_expression)
> ArrowKeyError: No function registered with name: and_
```
The expression looks like this :
```python
<pyarrow.compute.Expression invert(and_(is_in(Promo Year, {value_set=int64:[
2024
], null_matching_behavior=MATCH}), is_in(Promo Week, {value_set=int64:[
2,
3,
4, ...], null_matching_behavior=MATCH})))>
```
### Component(s)
Python
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] pyarrow.compute.and_ and operator.and_ not equal [arrow]
Posted by "MCRE-BE (via GitHub)" <gi...@apache.org>.
MCRE-BE closed issue #42119: [Python] pyarrow.compute.and_ and operator.and_ not equal
URL: https://github.com/apache/arrow/issues/42119
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org