Conversation
kevinjqliu
approved these changes
Oct 29, 2024
| return pa.StructArray.from_arrays( | ||
| arrays=field_arrays, | ||
| fields=pa.struct(fields), | ||
| mask=struct_array.is_null() if isinstance(struct_array, pa.StructArray) else None, |
Contributor
There was a problem hiding this comment.
| pyarrow_table: pa.Table = pa.Table.from_pylist(records, schema=schema) | ||
| table.append(pyarrow_table) | ||
|
|
||
| assert pyarrow_table.to_pandas()["struct_field_1"].tolist() == table.scan().to_pandas()["struct_field_1"].tolist() |
Contributor
There was a problem hiding this comment.
Looks like the null masking is also done by pandas.
>>> pyarrow_table['struct_field_1']
<pyarrow.lib.ChunkedArray object at 0x10482c6d0>
[
-- is_valid:
[
false
]
-- child 0 type: string
[
""
]
-- child 1 type: int32
[
0
]
-- child 2 type: float
[
0
]
]
>>> pyarrow_table['struct_field_1'].to_pandas()
0 None
Name: struct_field_1, dtype: object
kevinjqliu
approved these changes
Oct 29, 2024
Contributor
Author
|
Thanks for the prompt review @kevinjqliu |
sungwy
pushed a commit
to sungwy/iceberg-python
that referenced
this pull request
Dec 7, 2024
* PyArrow: Pass in null-mask * Add missing flag
sungwy
pushed a commit
to sungwy/iceberg-python
that referenced
this pull request
Dec 7, 2024
* PyArrow: Pass in null-mask * Add missing flag
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.
Fixes #1255