Repository navigation
chore: review follow-ups for list.contains - #1
Merged
jonasdedden merged 3 commits intoOct 3, 2026
Merged
jonasdedden merged 3 commits into
jonasdedden merged 3 commits into
Conversation
5 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-ups from reviewing narwhals-dev#4001, opened against your branch so you can keep, change or drop each part.
Kernel (
_arrow/utils.py)_list_blocks(chunking) and_list_block_contains(the count). Empty chunks are skipped, andor 0is gone, sincepc.maxof a non-empty block is never null.Your benchmark script, with two added variants and two many-chunk cases. All variants gave identical results. The script as posted had a few truncated lines, which I filled in.
Dask
Listcasts supported,nw.lit(None, nw.List(...))stopped raising and returned a String column instead, because Dask scalars drop the dtype (dask scalars don't preserve dtype dask/dask#11637, the same cause as the xfailedtest_date_lit). It raisesNotImplementedErroragain.convert-stringoff), so it is now tested instead of marked# pragma: no cover.Tests
test_contains_chunkedreplaces the pyarrow-only chunk test. It runs on every eager backend, with tiny block sizes so that both slicing and combining run.test_contains_256_matchescovers the uint8 to uint16 boundary, where 256 matches would wrap to 0.list.containswrong on chunks sliced from the same array. fix: Fixlist.containson multi-chunk sliced lists pola-rs/polars#29635 fixes it but is unreleased, so the test xfails Polars>=1.44 for now.assert_frame_equal_test.py.AI assistance: reviewed and drafted with Claude Code. I have read the whole diff.