Matching GETPART() behavior between dialects - #547
Merged
Merged
Conversation
john-sanchez31
commented
Aug 6, 2026
|
|
||
| # float vs None. Convert to nullable floats | ||
| if any(isinstance(elem, (float, NoneType)) for elem in column_a) and any( | ||
| if all(isinstance(elem, (float, NoneType)) for elem in column_a) and all( |
Contributor
Author
There was a problem hiding this comment.
Prevents a column with None type and for example string entering the if.
hadia206
reviewed
Aug 6, 2026
hadia206
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. I have a couple of questions regarding Oracle tests.
| SECOND_ARGUMENT AS delim, | ||
| THIRD_ARGUMENT AS idx | ||
| THIRD_ARGUMENT AS idx, | ||
| 0 AS is_last |
Contributor
There was a problem hiding this comment.
Add comment clarifying what's the purpose of this.
Comment on lines
+491
to
+494
| if custom_functions_test_data.test_name == "get_part_test": | ||
| # In Oracle None and empty string are treated the same, so we need to | ||
| # modify the reference solution data to match this behavior. | ||
| return PyDoughPandasTest( |
Contributor
There was a problem hiding this comment.
Isn't get_part_test already updated above in the same file. Why change here again?
Contributor
Author
There was a problem hiding this comment.
Yes, this test is from custom_functions not defog so I deleted the first one good catch!
knassre-bodo
approved these changes
Aug 12, 2026
knassre-bodo
left a comment
Contributor
There was a problem hiding this comment.
Make sure to document the new behavior in functions.md, otherwise LGTM :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked ticket
Closes #403
Type of change
What changed and why?
GETPART(). Makes index out of range and when the delimiter is at the beginning/end of the stringGETPART(".string.", ".", idx)return empty string''instead of NULL. This matches the Snowflake functionSPLIT_PARTon whichGET_PARTis based.''andNoneget_part_test,replace,strip,step_slicing,padding_functions,get_part_testandget_part_multiple)How I tested this?
Notes for reviewers