GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — to_columns, to_dataframe, and to_arrow drop every property that the first row lacks, and export_to_csv raises after writing part of the file · Issue #113 · humemai/arcadedb-embedded-python
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
to_columns, to_dataframe, and to_arrow drop every property that the first row lacks, and export_to_csv raises after writing part of the file #113Copy link Copy link Closed DescriptionLevel: bindings (Java bridge and Python). ArcadeDB documents are schemaless, so a property that is missing from the first row of a result set is legal and common (an optional field). Repro The script prints to stdout. The JVM's own log lines go to stderr and are discarded by the command below. uv venv .venv
uv pip install --python .venv/bin/python arcadedb_embedded-26.10.1.dev0-cp312-cp312-manylinux_2_34_x86_64.whl numpy pandas pyarrow
.venv/bin/python repro-6-columnar-drops-columns.py 2>/dev/null"""to_columns, to_dataframe and to_arrow take the column set from the FIRST row, so a property the first row lacks is dropped.""" import os import tempfile import arcadedb_embedded as arcade from arcadedb_embedded.jvm import start_jvm start_jvm(heap_size="2g") db = arcade.create_database(os.path.join(tempfile.mkdtemp(prefix="hb6-"), "db")) db.command("sql", "CREATE DOCUMENT TYPE Event") with db.transaction(): db.command("sql", "INSERT INTO Event SET n = 1, kind = 'start'") db.command("sql", "INSERT INTO Event SET n = 2, kind = 'stop', reason = 'timeout'") db.command("sql", "INSERT INTO Event SET n = 3, kind = 'stop', reason = 'user'") Q = "SELECT FROM Event ORDER BY n" print("to_list :", db.query("sql", Q).to_list()) print("to_json_list :", db.query("sql", Q).to_json_list()) print("to_columns :", {k: (v.tolist() if hasattr(v, "tolist") else v) for k, v in db.query("sql", Q).to_columns().items()}) print("to_dataframe :", db.query("sql", Q).to_dataframe().to_dict("list")) print("to_arrow :", db.query("sql", Q).to_arrow().to_pydict()) print() print("the same rows in the other order (first row has every property):") Q2 = "SELECT FROM Event ORDER BY n DESC" print("to_dataframe :", db.query("sql", Q2).to_dataframe().to_dict("list")) db.close() Output Wheel In the output, Cause
The docs for Expected Every property that any row has appears as a column, with a null for the rows that lack it, as Proposed fix Compute the column set as the union of the property names of every row, in order of first appearance, instead of the first row's names. Within one batch that is a change to Related issues ArcadeData#6758 (closed) is the same pinned column spec, fixed only for names that contain a quote, a backslash, or a semicolon. In this repository's tracker no issue is about this. The searches for Related reports from the same review: #114 (Arrow type follows batch size), #115 (DECIMAL columns). Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |