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.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1565789
Github Issue SNOW-1565789:
Column.isin()
fails with empty list #1999Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This PR solves the problem that an incorrect SQL query gets generated if
Column.isin()
get called with an empty list (notNone
).I'm not sure if the place for handling this is chosen wisely. I've tried several other locations, e.g. handling empty lists or Nones in
InExpression
, but there are a few places that rely onInExpression.values
being an iterable, so I pickedColumn.isin()
which seems the place with the minimum impact.I've assumed that the expected result of an empty
isin()
would be an empty dataframe, following the logic that an intersection of any set with the empty set is again the empty set.And also since the following SQL queries give an empty table as result:
I'd be glad if parts of this PR might be helpful, but I'm also aware that this could be a tricky issue, so take whatever is useful, no hard feelings.