Repository navigation
Docs: Importing and exporting data, and DataFrames, Arrow and columns, with tests that pin each statement first - #282
Merged
Conversation
tae898
force-pushed
the
docs/267-import-export-dataframe
branch
from
November 6, 2026 03:46
ea57d64 to
a0fda77
Compare
tae898
marked this pull request as ready for review
November 6, 2026 04:22
…, with tests that pin each statement first (refs #267) Rows 4 and 5 of the audit in #267. Both topics were promised in the README and shown nowhere, so a user could not tell which call loads a file, a frame or a column, what a failed import leaves, or how nulls and declared types behave. Tests first, as for the Transactions page: test_import_export_behavior.py and test_dataframe_columns_behavior.py pin each statement of the two new pages, and test_docs_data_exchange_pages.py runs every Python block of both pages in order on both backends and checks the printed output. The importer rules (one owned transaction per file of documents, rollback on any failure, joining a caller's transaction, skip mode needing the transaction for itself, the FAIL row of the SQL statement for an unusable setting, the rollback of every open transaction by EXPORT DATABASE) were read from the engine source and its own tests, since nothing here could run them on the laptop. The reader semantics of the native build were checked by running arcadedb/_native/columns.py directly against the expected output of the page. The pages say what the tests prove and link the main manual for importer settings, SQL syntax and data types. No size threshold is stated for the choice between the paths, because no test here measures one. The nav gets two adjacent lines and the pages are linked from Quickstart, Databases and queries and Bulk loads. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ften what no test pins (refs #267) Applies the editorial review (prose, headings, the table of keyword arguments, two unused imports). Then the review's doubtful sentences: the page headers now name the test files that really pin the statements (test_dataframe_ingest.py, test_insert_columns.py, test_resultset_arrow.py, test_columnar_readers.py, test_resultset.py and the importer and exporter tests, not only the new behavior files); the asynchronous-writers reason, the 'no row is ever a Python object' claim, the column order of to_columns and the statistics keys of export_database are softened to what is pinned; the page says nothing about whether db.export_database rolls back an open transaction beyond 'commit before you export'; a new test pins that a vertex frame inside your own transaction is refused and leaves the transaction alone; a sentence explains the 10,000 default of insert_columns and insert_dataframe next to the native insert_many default of 1000 (both read in the source: the load calls pass their own value). The chunk split and the DATE midnight were already pinned (test_rows_are_converted_one_batch_at_a_time, test_columnar_readers.py). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tae898
force-pushed
the
docs/267-import-export-dataframe
branch
from
November 6, 2026 05:49
a0fda77 to
cd4bf3c
Compare
This was referenced Nov 6, 2026
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.
Third slice of #267 (audit of the docs against 26.11.1). It covers rows 4 and 5: two new pages,
how-to/import-export.adoc(Importing and exporting data) andhow-to/dataframes-and-columns.adoc(DataFrames, Arrow and columns).Tests first, as for the Transactions page.
tests/test_import_export_behavior.pyandtests/test_dataframe_columns_behavior.pypin each statement of the two pages, andtests/test_docs_data_exchange_pages.pyruns every Python block of both pages in order on both backends and checks the printed output. The pages say only what those tests prove, link the main manual for importer settings, SQL syntax and data types, and stay DSL-first (statements throughdb.commandanddb.query,uv addfor the extras). The nav gets two adjacent lines, and the pages are linked from Quickstart, Databases and queries and Bulk loads. No size threshold is stated for choosing a path, because nothing in this repository measures one; the page says what each path takes and links the measured commit sizes.I could not run the tests on the laptop (CI runs them). The JVM test workflow on the current head passes (24 of 24 jobs). The first run found one wrong statement: on Windows
EXPORT DATABASEdoes not refuse a name with a forward slash, because the engine rejects..and the platform's own path separator. The test and the page now say that per platform. The native parity legs run now that the PR is ready. The importer and exporter rules come from reading the engine source and its own tests (CSVImporterFormat.loadDocuments,ImportDatabaseStatement,ExportDatabaseStatement), the frame and column rules fromdataframe.pyandcore.py. The native reader semantics were checked by running_native/columns.pydirectly against the output the page shows, and the settings mapping, the type table, the batch sizes and the Arrow conversion by calling the helpers directly. If a test fails in CI, the page statement it backs is wrong and gets fixed here. The ones I am least sure of:probe_onlygivingPROBE_ONLYon the native build, an import inside the caller's transaction on the native build, the error type of a rejectedEXPORT DATABASEname, and theFAILrow of the SQL statement.Behavior worth a look, none of it filed:
EXPORT DATABASEcallsrollbackAllNested()when a transaction is active, so rows you wrote and did not commit are gone after it.db.export_database(...)does not go through the statement.IMPORT DATABASEreports an unusable setting value (commitEvery = 'many') as a row withresultFAILand areason, whereimport_documentsraisesArcadeDBErrorfor the same mistake. Other import failures raise.on_row_error="skip"commits row by row. An import inside your own transaction joins it and commits nothing. Skip mode inside your transaction raises.insert_columnsdoes not check a column against a declared property: a float column into anINTEGERproperty is stored without its fraction (1.5becomes1), whileinsert_dataframeandinsert_arrowrefuse it withTypeErrorbefore writing.insert_columnsrefuses adatetime64array withTypeErroron both packages, so the JVM-only rejection that was suspected is not there. A list ofdatetimeobjects loads, and adatetime64column loads throughinsert_dataframe.to_columns()andto_arrow()get the rows: the JVM build reads batches ofbatch_sizerows from the engine's column buffer, the native build reads every row into Python dicts first and ignoresbatch_size(a test spies on each).to_dataframe(convert_types=...)accepts the argument and ignores it, and a missing pandas raises the plainImportErrorwhere the JVM build adds theuv addhint.to_columns()returnsNonewithout numpy andto_arrow()returnsNonewithout pyarrow, whileto_polars()andto_dataframe()raise.RecordBatchReadergiven toinsert_arrowis read to the end before the first batch is written (read_all()), so it is no way to stream a source larger than memory. The page does not say this, because no test pins it.Left of #267: rows 3 (types and datetimes, in progress elsewhere), 8 (Python functions and events), 9 (record objects), 10 (
set_wal_flush,fileSync,txWalGroupCommit), 11 (AsyncExecutor) and 12 (theSchemaAPI line). Rows 6, 7 and 13 and the stale statements were planned for #264 and #276 and are not re-checked here.The datetime rule on the Arrow section of the DataFrame page links to the Datetimes section of the Values and records page (#281, merged).
A JVM test run on the first commit (run 42156099576) passed on linux/amd64 Python 3.13 with 2414 tests, which include the three new files. An editorial pass and the softened sentences are in the second commit.
Refs #267
🤖 Generated with Claude Code