Repository navigation
feat: filter and take for dictionary arrays - #716
Conversation
db89029 to
b8abbec
Compare
|
@lesam is this still a draft? Or is it ready for review? |
b8abbec to
512d8d0
Compare
|
@zeroshade I've updated the PR with some comments, it's ready for review. |
Add 'take' and 'filter' implementations for dictionary arrays. These implementations simply filter/take on the index column and shallow-copy the dictionary.
512d8d0 to
555fb02
Compare
zeroshade
left a comment
There was a problem hiding this comment.
LGTM! Very nice, just a couple nitpicks so let me know what you think.
Also, can we just add a single line documentation note explaining that the dictionary itself isn't compacted or modified? i.e. after execution of the filter, the dictionary itself would still contain all the same values. This is intentional, but might be non-obvious.
| for _, dt := range baseBinaryTypes { | ||
| suite.Run(t, &FilterKernelWithString{dt: dt}) | ||
| } | ||
| suite.Run(t, &FilterKernelWithString{dt: &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Int8, ValueType: arrow.BinaryTypes.String}}) |
There was a problem hiding this comment.
Can we add tests for a few more combinations of different index/value types? Perhaps add a numeric dict test or a complex type like list/struct? Just to add more type coverage to the tests for this.
There was a problem hiding this comment.
I've added a commit with more tests
0187fe1 to
6c6ece4
Compare
I've added this on dictionaryTake and dictionaryFilter - did you want it on the public generic Take / Filter doc comment as well? My feeling is not to add it to the public method contract, to give more flexibility to change it in the future. |
6c6ece4 to
390e769
Compare
zeroshade
left a comment
There was a problem hiding this comment.
LGTM. Will merge once CI finishes
Add 'take' and 'filter' implementations for dictionary arrays. These implementations simply filter/take on the index column and shallow-copy the dictionary.
#714
Rationale for this change
It would be nice for 'take' and 'filter' to work for all array encodings, including dictionary
What changes are included in this PR?
Just 'take' and 'filter' implementations and an addition to the tests
Are these changes tested?
Unit tests added
Are there any user-facing changes?
These will now work instead of failing with an error like: