feat(bigframes): Transpiler supports more string ops#17693
feat(bigframes): Transpiler supports more string ops#17693TrevorBergeron wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for compiling f-strings, nullity checks (such as 'is None' and 'is not None'), and various string operations (e.g., capitalize, islower, isupper) in Python UDFs. Feedback is provided regarding the Polars compilation of 'IsLowerOp' and 'IsUpperOp', where the current regex patterns incorrectly require the entire string to consist only of letters, failing to match Python's native behavior which allows non-cased characters.
| return val | ||
|
|
||
|
|
||
| def _compile_bytecode_to_py_expr(func: Callable) -> expression.Expression: |
There was a problem hiding this comment.
(Not an action item in this PR) The length of this function is getting out of hand. We will probably need to break it up sometime in the future.
| pd_result = pd.Series( | ||
| ["Fruit: apple!", "Fruit: banana!", "Null value"], dtype="string" | ||
| ) | ||
| assert_series_equal(bf_result, pd_result, check_dtype=False) |
There was a problem hiding this comment.
style nit: please add empty lines between the "arange" "act" "assert" blocks to demarcate them, and apply the style to the rest of the changes too.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕