Skip to content

Add Python Appender for scalar create, append, flush and close - #585

Open
daviddallakyan2005 wants to merge 1 commit into
duckdb:mainfrom
daviddallakyan2005:appender
Open

Add Python Appender for scalar create, append, flush and close#585
daviddallakyan2005 wants to merge 1 commit into
duckdb:mainfrom
daviddallakyan2005:appender

Conversation

@daviddallakyan2005

@daviddallakyan2005 daviddallakyan2005 commented Aug 16, 2026

Copy link
Copy Markdown

Python still has no Appender. This adds conn.appender(table, schema=None, catalog=None) with append, flush, close, a context manager, and column_count, for scalar types.

Follows #369

This is the first of three stacked PRs. Chunks: #586. Query appender: #587.

append() converts each cell to a Value and uses the C++ row Append API. Use append_chunk for bulk inserts, which writes into vectors in place. append_chunk is #586.

This does not change conn.append(table, df).

How to test

OVERRIDE_GIT_DESCRIBE=v1.5.5
.venv/bin/pytest tests/fast/test_appender.py tests/fast/test_insert.py tests/fast/test_context_manager.py tests/fast/test_module.py -q

After this commit: 9 new tests in tests/fast/test_appender.py passed. Insert, context manager, and module tests also passed.

On the full stack I also ran tests/fast excluding spark: 1655 passed. Two failures (missing reraise fixture, missing typing_extensions for experimental spark) fail the same way on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant