Skip to content

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Feb 17, 2025

This PR fixes #16265

While I was at it, I realized that isnotin doesn't transform correctly, it should use ExpressionType::COMPARE_NOT_IN, not just wrap the COMPARE_IN result with an OPERATOR_NOT

I wonder if the optimizer catches this and made this change already, or it doesn't because the behavior is not equivalent for the two cases - either way, better to fix it here.

@Mytherin
Copy link
Collaborator

Thanks for the PR! LGTM - should this go into main or v1.2?

@Tishj
Copy link
Contributor Author

Tishj commented Feb 17, 2025

Hmm yes and no, I'm not sure about the isnotin fix
If ~(a IN <rhs>) is equivalent to a NOT IN <rhs> then it's fine to hit 1.2, if it's not then the behavior of this is now different.
Not sure if we care that much, I doubt anyone is using isnotin yet, the Expression API is not getting much adoption yet I feel

@Mytherin
Copy link
Collaborator

NOT (a IN rhs) is equivalent to a NOT IN rhs yes.

I think rebasing to v1.2.1 makes sense, could you rebase?

@Tishj Tishj force-pushed the python_empty_isin_fix branch from 1937e5f to 4f69a1d Compare February 18, 2025 09:28
@Tishj Tishj changed the base branch from main to v1.2-histrionicus February 18, 2025 09:29
@duckdb-draftbot duckdb-draftbot marked this pull request as draft February 18, 2025 09:29
@Tishj Tishj marked this pull request as ready for review February 18, 2025 09:29
@Mytherin Mytherin merged commit e1775bc into duckdb:v1.2-histrionicus Feb 18, 2025
21 checks passed
@Tishj Tishj deleted the python_empty_isin_fix branch February 18, 2025 13:37
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Mar 7, 2025
Fix issue related to hang when all candidates are eliminated in refinement (duckdb/duckdb#16288)
[Python Dev] Fix crash with empty args for `isin` | Fix transformation for `isnotin` (duckdb/duckdb#16271)
[Dev] `register_filesystem` stubs, use `fsspec.AbstractFileSystem`, not `str` (duckdb/duckdb#16266)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isin triggers assertionfailure
2 participants