Skip to content

feat(rust): Replace raw string production to pyo3 API#27271

Draft
tylerriccio33 wants to merge 12 commits intopola-rs:mainfrom
tylerriccio33:arrow-pushdown-pyo
Draft

feat(rust): Replace raw string production to pyo3 API#27271
tylerriccio33 wants to merge 12 commits intopola-rs:mainfrom
tylerriccio33:arrow-pushdown-pyo

Conversation

@tylerriccio33
Copy link
Copy Markdown
Contributor

@tylerriccio33 tylerriccio33 commented Apr 10, 2026

Draft/WIP for now!

This closes #26591 and supersedes the code from #24255 .

Follow up to #27091

This PR takes code that builds raw python strings pushed down and evaluated using ast.eval. I can't use this area of the codebase at work since it uses eval. It does so by converting the polars expressions to arrow predicates and then from predicates represented in rust to python objects via pyo3. These objects are used in the scanning of arrow datasets at the python level.

In a future PR I'd like to remove the string conversion entirely, it's currently used as a caching key. I originally mocked out swapping that out but I felt it was out of scope.

In a future PR I'd like to do this for the iceburg scans too (I'll really need this at work), which can leverage the arrow conversion layer.

I used AI for:

  1. Help with determining exactly where the polars -> arrow IR conversion needed to take place.
  2. Help with timezone and date math when going from polars to python.
  3. Help with small oop rust questions in general. I use rust for quantitative computing, this was very different.

I'd appreciate feedback/critique if there are better ways to accomplish things, especially in rust!

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature rust Related to Rust Polars labels Apr 10, 2026
@tylerriccio33 tylerriccio33 marked this pull request as ready for review April 16, 2026 02:23
@tylerriccio33 tylerriccio33 marked this pull request as draft April 16, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or an improvement of an existing feature rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build pyarrow predicates via pyarrow API instead of string formatting / eval in predicate_to_pa

1 participant