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_arrow: a column's type depends on batch_size (an all-NULL batch turns an int column into strings), and a mixed-type column raises a raw ArrowInvalid · Issue #114 · 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_arrow: a column's type depends on batch_size (an all-NULL batch turns an int column into strings), and a mixed-type column raises a raw ArrowInvalid #114Copy link Copy link Closed DescriptionLevel: bindings. Two defects in 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-7-to-arrow-types.py 2>/dev/null"""to_arrow: the type of a column depends on batch_size, and a column of mixed types raises a raw pyarrow error.""" 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="hb7-"), "db")) db.command("sql", "CREATE DOCUMENT TYPE Reading") with db.transaction(): # rows 3 and 4 carry no "level" at all (a legal schemaless document), rows 1, 2 and 5 carry an int for n, level, tags in [(1, 10, ["a"]), (2, 20, []), (3, None, ["b", "c"]), (4, None, []), (5, 50, ["d"])]: if level is None: db.command("sql", "INSERT INTO Reading SET n = ?, tags = ?", n, tags) else: db.command("sql", "INSERT INTO Reading SET n = ?, level = ?, tags = ?", n, level, tags) Q = "SELECT FROM Reading ORDER BY n" for batch_size in (25_000, 2, 1): t = db.query("sql", Q).to_arrow(batch_size=batch_size) print(f"to_arrow(batch_size={batch_size:>6}):") for col in ("level", "tags"): print(f" {col:<6} {str(t.schema.field(col).type):<12} {t.column(col).to_pylist()}") cols = db.query("sql", Q).to_columns(batch_size=batch_size) print(f"to_columns(batch_size={batch_size:>6}): level is a {type(cols['level']).__name__}: {list(cols['level'])}") print() with db.transaction(): db.command("sql", "INSERT INTO Reading SET n = 6, mixed = 1") db.command("sql", "INSERT INTO Reading SET n = 7, mixed = 'seven'") for name, read in [("to_list", lambda r: r.to_list()), ("to_columns", lambda r: r.to_columns()), ("to_dataframe", lambda r: r.to_dataframe()), ("to_arrow", lambda r: r.to_arrow())]: try: read(db.query("sql", "SELECT n, mixed FROM Reading WHERE n >= 6 ORDER BY n")) print(f"{name:<13}: ok") except Exception as e: print(f"{name:<13}: {type(e).__module__}.{type(e).__name__}: {e}") db.close() Output Wheel A property test (hypothesis 6.168.3, seed 20261003) over seven column types with NULLs (integer, float, bool, str, datetime, date, and list; the DECIMAL and map columns are left out because of their own defects) finds the same thing without any hand-built data. At the default batch size it passes 200 examples. With Cause
The mixed-type failure is the same Expected The Arrow type of a column does not depend on Proposed fix In Related issues ArcadeData#7108 (closed) added In this repository's tracker no issue is about this. The searches for Related reports from the same review: #113 (columns dropped), #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. |