Skip to content

Conversation

MiguelElGallo
Copy link
Owner

Summary

  • upgrade the DuckDB dependency to 1.4.0 and bump the project version to 0.0.2-beta
  • ensure the DuckDB backend materializes RecordBatchReader results into pyarrow Tables for compatibility with DuckDB 1.4.0
  • refresh the README to call out the DuckDB 1.4.0 target and DuckLake 0.3 release announcement

Testing

  • uv run pytest

https://chatgpt.com/codex/tasks/task_e_68cabfe203b0832fb30a67ed9df90583

@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 14:25
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mpzsql/backends/duckdb_backend.py 96.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the DuckDB dependency from version 1.3.2+ to exactly version 1.4.0 and releases version 0.0.2-beta of the project. The primary change ensures compatibility with DuckDB 1.4.0 by materializing RecordBatchReader results into pyarrow Tables throughout the codebase.

  • Upgrade DuckDB dependency to exactly version 1.4.0
  • Add _ensure_arrow_table() method to handle different Arrow result types from DuckDB
  • Update project version to 0.0.2b0 and refresh README documentation

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/mpzsql/backends/duckdb_backend.py Adds Arrow result materialization logic and updates all DuckDB query executions to use the new helper method
src/mpzsql/init.py Updates version string from 0.1.0 to 0.0.2b0
pyproject.toml Pins DuckDB dependency to exactly version 1.4.0 and updates project version
README.md Updates documentation to mention DuckDB 1.4.0 target and DuckLake 0.3 release

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 311 to 318
if isinstance(arrow_result, Iterable):
batches = list(arrow_result)
if batches and all(isinstance(batch, pa.RecordBatch) for batch in batches):
return pa.Table.from_batches(batches)
if hasattr(arrow_result, "schema") and isinstance(
arrow_result.schema, pa.Schema
):
return pa.table({}, schema=arrow_result.schema)
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isinstance(arrow_result, Iterable) check will match strings and other non-RecordBatch iterables, potentially causing unexpected behavior. Consider checking for more specific types like pa.RecordBatchReader or use a more restrictive type guard.

Copilot uses AI. Check for mistakes.

@MiguelElGallo MiguelElGallo merged commit efe2acd into main Sep 17, 2025
8 checks passed
@MiguelElGallo MiguelElGallo deleted the codex/update-duckdb-to-version-1.4.0 branch September 17, 2025 15:53
MiguelElGallo added a commit that referenced this pull request Sep 26, 2025
- Remove problematic _ensure_arrow_table method and its dependencies
- Restore direct .arrow() calls without additional materialization wrappers
- Remove collections.abc.Iterable and typing.Any imports
- Revert all DuckDB 1.4.0 compatibility changes that caused issues

This rollback restores the duckdb_backend.py file to commit 5910739,
which was the last known working state before the problems started.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant