advitrocks9 opened a new pull request, #51004:
URL: https://github.com/apache/arrow/pull/51004
### Rationale for this change
The invalid-operator error prints the column name instead of the operator:
```
>>> pq.filters_to_expression([[('a', '=!', 1)]])
ValueError: "a" is not a valid operator in predicates.
```
The message means `op`, the value that failed to match; `col` was already
consumed by `ds.field(col)` above. The mixup came in 992bee2c8, when a
`.format()` over the whole `(col, op, val)` tuple was converted to an f-string.
First shipped in 21.0.0.
### What changes are included in this PR?
The message interpolates `op`. The existing test already passes an invalid
operator and only checked the exception type, so it gains a `match=`.
### Are these changes tested?
The `match=` fails on unpatched main:
```
E AssertionError: Regex pattern did not match.
E Expected regex: '"=<" is not a valid operator'
E Actual message: '"integers" is not a valid operator in predicates.'
```
`pyarrow/tests/parquet/` passes 316 either way.
### Are there any user-facing changes?
Only the message text. Same exception, same trigger.
* GitHub Issue: #47369
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]