-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(python): Add StringView and BinaryView IO to Python bindings (#637)
This PR implements StringView support in the Python bindings. It is a thin wrapper around the C functions added, although we should perhaps abstract some of the buffer info calculation into the C library since I had to work around that in the R bindings as well. ```python import nanoarrow as na array = na.Array(["abc", "def", None, "longer than 12 bytes"], na.string_view()) array #> nanoarrow.Array<string_view>[4] #> 'abc' #> 'def' #> None #> 'longer than 12 bytes' array.buffers #> (nanoarrow.c_buffer.CBufferView(bool[1 b] 11010000), #> nanoarrow.c_buffer.CBufferView(string_view[64 b] b'\x03\x00\x00\x00abc\x00\x00\x00\x00\x00\x00\x00\x00\x00'...), #> nanoarrow.c_buffer.CBufferView(string[20 b] b'longer than 12 bytes'), #> nanoarrow.c_buffer.CBufferView(int64[8 b] 20)) ``` --------- Co-authored-by: William Ayd <[email protected]>
- Loading branch information
1 parent
97e7c61
commit d6ef480
Showing
8 changed files
with
163 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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