Added type_insensitive parameter for equals_string_part operator#1787
Added type_insensitive parameter for equals_string_part operator#1787aniemes wants to merge 5 commits into
Conversation
…. Added tests for this and a negative test for the original operator without the param
There was a problem hiding this comment.
The PR looks great to me. I will recommend minor updates to the tests for covering the edge cases of
- No regex match
- Empty string/null target
- Case for deos_not_equal_string_part False
- Test for leading zero behavior.
There was a problem hiding this comment.
Hi Ramil,
Thank you for reviewing it! I will work on the changes now to cover the edge cases and update the Operator.md file as you said above.
Thanks!
Adam
There was a problem hiding this comment.
@RamilCDISC
So I am having some trouble with the 'no regex' as this seems to be expected. I added this into a new test case:
if operator == "equals_string_part": result = dataframe_type.equals_string_part( { "target": "target", "comparator": comparator, "regex": "(.*)", "type_insensitive": True, } )
But this is still using regex. Can you suggest how to test this without using regex? I am also have trouble with the empty string/null targets.
I tried this:
( {"VAR2": ["", ""], "target": [0, 0]}, "VAR2", "equals_string_part", PandasDataset, [True, True], )
And an empty target array but neither worked.
Pasted test file for reference.
There was a problem hiding this comment.
My intention with 'no regex match' was to ask for a test where the regex does not return any match, not to test without a regex. I see that my comment was not very clear. The edge cases I requested is to have a case where the passed regex does not return any match. Passing a regex is required.
For the null/empty target case, your example has empty values in VAR2 not in the target. target is '[0,0]'. I would test it with explicit empty/null values in target columns.
No description provided.