Repository navigation
Rows without properties keep their count in to_arrow, to_polars and to_dataframe - #435
Merged
Merged
Conversation
Collaborator
Author
|
The first run failed on the free-threaded leg (Python 3.14t): that leg runs |
tae898
force-pushed
the
fix/429-rows-without-properties
branch
from
November 22, 2026 12:17
38a35ec to
af95423
Compare
…o_dataframe
A result whose rows have no property (records created with none) had N rows in to_list() and count() and no row in the columnar readers: merge_arrow and merge_columns returned the empty result whenever there were no column names, and the row count went with them. merge_arrow now returns a table of N rows and no column, and to_dataframe gets the row count next to the dict of columns on both wheels, so it returns a frame of N rows and no column. to_polars follows to_arrow.
to_columns() keeps returning {} for such a result: a dict of columns has no place for a row count. Its docstring and the how-to page say so.
Closes #429
The free-threaded leg (Python 3.14t) runs test_columnar_readers.py without Polars installed, so the import in the new test failed there. The to_polars() assertion is now its own test in test_dataframe_columns_behavior.py, which the legs without Polars do not run.
tae898
force-pushed
the
fix/429-rows-without-properties
branch
from
November 22, 2026 13:05
af95423 to
897ea1d
Compare
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.
Closes #429
Thank you @shaunpatterson for the report and the clear cause. On the question you left open:
to_arrow(),to_polars()andto_dataframe()now keep the rows, andto_columns()stays{}and is documented, because a dict of columns has no place for a row count.What changes, in the decoder both wheels share (
src/arcadedb/_columnar.py) and the two readers:merge_arrow: frames with rows and no column name give a table of N rows and no column (pa.Table.from_struct_arrayof N empty structs;pa.table({})has no rows).to_polars()reads that table.to_dataframe(): the reader hands the row count over next to the dict of columns (_read_columns_countedon the JVM build,_columns_countedon the native one), anddataframe_from_columnsreturns a frame of N rows and no column, aspandas.DataFrame([{}, {}, {}])is.to_columns(): unchanged,{}. Its docstring on both builds anddataframes-and-columns.adocsay why and what to read instead.Tests:
test_rows_without_properties_keep_their_count(atbatch_size25,000 and 2) andtest_an_empty_result_is_still_empty_in_every_readerintests/test_columnar_readers.py.Checked:
compile()on the four Python files,uvx pre-commit run --fileson the five files, and the shared decoder called directly with pyarrow 26.0.1 and pandas 3.1.1 (3 rows and no column frommerge_arrowanddataframe_from_columns; an empty result stays empty). I reproduced the bug on the publishedarcadedb26.11.1.post4 first (3 rows into_list(), 0 into_arrow()andto_dataframe()). I did not run the two new tests on a built wheel; the platform jobs of this pull request do.