sanjana459 commented on PR #4055:
URL: https://github.com/apache/iceberg-python/pull/4055#issuecomment-6031590123

   @Fokko I looked into these two failures. pyparsing 3.3.3 replaced 
`infix_notation` with a new iterative implementation, and when an operand fails 
to parse it drops that error and raises a new one at the start of the operand. 
So it's not only the test wording: on 3.3.3 a bad row filter like `foo = ` used 
to report `Expected ... (at char 6)` and now reports a grammar dump at char 0. 
Upstream has a related open regression (pyparsing/pyparsing#672); a 3.3.4 was 
mentioned but hasn't been released.
   
   Two options that work on both 3.3.2 and 3.3.3:
   
   1. Write the NOT/AND/OR precedence explicitly with a `Forward` instead of 
`infix_notation` (~10 lines). The existing tests pass unchanged on both 
versions, and on 10k random filters it gave the same results and error 
positions as the current grammar. Trade-off: it doesn't get 3.3.3's support for 
very deeply nested parentheses.
   2. Keep `infix_notation`, name the predicate so the 3.3.3 message is 
readable, and relax the two assertions. Smaller, but error positions on 3.3.3 
still point at the start of the operand.
   
   I'd lean toward 1. Happy to open a PR for whichever you prefer.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to