-
Notifications
You must be signed in to change notification settings - Fork 340
Fix TypeError in create_match_filter for Composite Keys with Single Unique Condition #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this! can you also add a test case too?
@kevinjqliu |
Old Senario |
@omkenge I think the ask is to add a test covering the case where there is a single condition. This test would have failed prior to your change, and should pass with your change. |
@corleyma @kevinjqliu |
Issue:
Solution:
|
@omkenge I ran into the same issue, and saw that you already fixed this 🚀 Thanks for jumping on this right away! I left some suggestions, but it looks like it is heading into the right direction 👍 |
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
@Fokko What is your opinion on Test Cases? my point of view is we do not need test cases for this change |
Co-authored-by: Fokko Driesprong <fokko@apache.org>
@omkenge can fix the import?
Should be:
|
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Thanks @omkenge for fixing this! Thanks @corleyma and @kevinjqliu for the review, I'll be merging this now since I'm also blocked by it :) |
Old Code Behavior:
Even if there's only one such condition, the code wraps it in an Or() operator.
But Or() is meant to combine two or more conditions (like “condition A OR condition B”).
If you give it only one condition, it complains because it expects a second condition.
New Code Behavior:
The new change checks how many conditions you have.
If there's only one condition, it simply returns that condition.
If there are more than one, it uses Or() to combine them.