Skip to content
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

fix(api): return NULL when NULL is passed to Array.zip #8652

Merged
merged 4 commits into from
Mar 17, 2024

Conversation

NickCrews
Copy link
Contributor

fixes #8650

@NickCrews NickCrews force-pushed the array_zip_nulls branch 3 times, most recently from e6a4830 to 9a7b6a0 Compare March 13, 2024 22:49
ibis/backends/tests/test_array.py Outdated Show resolved Hide resolved
ibis/expr/types/arrays.py Outdated Show resolved Hide resolved
ibis/backends/duckdb/compiler.py Outdated Show resolved Hide resolved
ibis/backends/duckdb/compiler.py Outdated Show resolved Hide resolved
@NickCrews
Copy link
Contributor Author

@cpcloud thanks for the review! all good suggestions, addressed them all. Check that you like the way I split out the new test, reusing a single decorator to avoid repeating myself.

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some suggestions that I will add via the GitHub UI.

ibis/backends/tests/test_array.py Outdated Show resolved Hide resolved
ibis/backends/tests/test_array.py Outdated Show resolved Hide resolved
ibis/backends/tests/test_array.py Outdated Show resolved Hide resolved
@cpcloud cpcloud added this to the 9.0 milestone Mar 15, 2024
@cpcloud cpcloud changed the title fix: fix Array.zip(NULL) fix(arrays): return NULL when NULL is passed to Array.zip Mar 15, 2024
@cpcloud cpcloud changed the title fix(arrays): return NULL when NULL is passed to Array.zip fix(api): return NULL when NULL is passed to Array.zip Mar 15, 2024
@cpcloud
Copy link
Member

cpcloud commented Mar 15, 2024

Interesting, looks like the backends that support zip (except clickhouse) all have this behavior by default, except DuckDB.

@cpcloud
Copy link
Member

cpcloud commented Mar 15, 2024

That said, the DuckDB implementation isn't calling a specific duckdb zip function, so it's kind of up to us to make it behave consistently.

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cpcloud cpcloud merged commit fac85f0 into ibis-project:main Mar 17, 2024
80 checks passed
@cpcloud cpcloud added the expressions Issues or PRs related to the expression API label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expressions Issues or PRs related to the expression API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Array.zip(NULL) gives [{f1: ..., f2:NULL}, {...}, ...], not NULL
2 participants