kuldeeepy opened a new pull request, #4012:
URL: https://github.com/apache/iceberg-python/pull/4012

   # Rationale for this change
   
   `pyiceberg.table` imports `pyiceberg.expressions.parser` at module level, 
but only `_parse_row_filter` uses it, when the row filter is a string. 
Importing it pulls in pyparsing, and through `pyparsing.testing` also unittest, 
argparse and difflib. So every `import pyiceberg.table` and `load_catalog` pays 
for it, even when no string filter is used.
   
   This moves the import into `_parse_row_filter`, the same way the file 
already imports `ArrowScan` locally. After the change pyparsing is no longer 
loaded by `from pyiceberg.catalog import load_catalog`, and the number of 
loaded modules goes from 389 to 361. On my machine that import takes about 6% 
less CPU time.
   
   ## Are these changes tested?
   
   Covered by the existing parser and row filter tests. `make lint` and `make 
test` pass.
   
   ## Are there any user-facing changes?
   
   No.
   
   This change was made with AI assistance (Claude Code). I checked the import 
paths and ran the measurements and tests myself.
   


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