Repository navigation
fix(#428): to_arrow and to_columns of differing rows do not depend on batch_size - #430
Merged
tae898 merged 1 commit intoNov 22, 2026
Conversation
… depend on batch_size The merge of several frames and the rows of one frame gave different results for a bool next to a number, maps with different keys and lists of ints next to floats. The merge now gives what one frame gives: no np.concatenate of a bool with numbers, struct and list chunks typed from all their values, a bool next to a float as double, and the text of a mixed column written by str() as inside one frame.
Collaborator
|
Thank you, merged for 26.12.1. |
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.
What does this PR do?
On the JVM wheel the type of a
to_arrow()column and the values of ato_columns()column of differing rows depended onbatch_size(#428). The rows of one frame and the rows of several frames went through two different merges. This PR makes the merge of frames give what one frame gives, which is also what the native wheel returns:merge_columnsno longer joins a bool with an int or float part throughnp.concatenate(Truebecame1); such a column is a list of the Python values, as in one frame._unify_arrow_chunk_types: struct chunks (maps with different keys) and list chunks (ints next to floats) are typed from all their values, aspa.arraytypes the rows of one frame; a bool next to a float isdouble, as in one frame._cast_all_to_stringwritesstr(v)(True,1.0), as the fallback inside one frame does, instead of Arrow's cast (true,1)._unify_arrow_chunk_types, which said there is no bool/int64 case, now describes these.Related issues
Closes #428
Performance changes
None claimed. The new branches run only for a column whose chunks disagree in type;
merge_columnsadds one set of numpy dtype kinds per column.Docs
None: the
to_arrowdocstring andhow-to/dataframes-and-columns.adocalready say that a column's type does not depend onbatch_size; the code now keeps that for these rows.Checklist
test_to_arrow_of_differing_rows_does_not_depend_on_batch_sizeandtest_to_columns_of_differing_rows_keeps_what_to_list_returns, six kinds of differing rows; they pass on the published native wheel 26.11.1.post4 with and without the change, so the native result is the reference)tests/file that usesto_arrow,to_columns,to_dataframe,to_polarsor_columnar, thetest_native_*files excluded asconftest.pydoes;test_columnar_readers.pyandtest_column_frames.pyalso on the native package with this_columnar.py)uvx pre-commit run --files <changed files>passes