fix(duckdb): use to_arrow_table() instead of deprecated fetch_arrow_table()#1
Merged
Merged
Conversation
DuckDB 1.5 deprecated DuckDBPyRelation/DuckDBPyConnection.fetch_arrow_table() in favor of to_arrow_table() and emits a DeprecationWarning on every call. The DuckDB backend used the old name in five spots (get_schema, list_catalogs, list_databases, _metadata, _get_schema_using_query). Route all five through a small _to_pyarrow_table() helper that prefers to_arrow_table() when available and falls back to fetch_arrow_table() for the older duckdb versions ibis still supports (duckdb>=0.10.3), where to_arrow_table is not yet defined on the connection/cursor object. A plain rename breaks those versions (218 backend test failures in CI). Return type (pyarrow.Table) and all downstream usage are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2a5622f to
0f20c9c
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.
What
Route the five DuckDB-backend arrow extractions (
get_schema,list_catalogs,list_databases,_metadata,_get_schema_using_query) through a small_to_pyarrow_table()helper.Why
DuckDB 1.5 deprecated
DuckDBPyRelation/DuckDBPyConnection.fetch_arrow_table()in favour ofto_arrow_table(), emitting aDeprecationWarningon every call (this floods the dq-platform qserviceworker logs).A plain rename to
to_arrow_table()is not safe: ibis supportsduckdb>=0.10.3, and on those older versionsto_arrow_tabledoes not exist on the connection/cursor object — a rename produces 218 backend test failures (AttributeError: 'DuckDBPyConnection' object has no attribute 'to_arrow_table').The helper prefers
to_arrow_table()when present (new duckdb → no warning) and falls back tofetch_arrow_table()otherwise (old duckdb → still works, not yet deprecated there):Notes
pyarrow.Table) and all downstream usage unchanged; verified both helper branches and that theDeprecationWarningis gone on duckdb 1.5.1.12.0.0release commit (01e429b) that dq-platform pins, so it carries no unrelated changes.🤖 Generated with Claude Code