Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): read_database now properly handles empty result sets from arrow-odbc #14916

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Mar 8, 2024

Closes #14906.

If nothing is yielded from read_arrow_batches_from_odbc (eg: no matching rows for the given query), we now construct an empty RecordBatch with the correct schema and yield that, allowing for successful frame init (vs the current ValueError).

Reproduced the issue (and validated the fix) against a local SQL Server instance running in a Docker container, connecting via ODBC.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Mar 8, 2024
@ritchie46 ritchie46 merged commit b2d7e77 into pola-rs:main Mar 8, 2024
14 checks passed
@alexander-beedie alexander-beedie deleted the empty-arrow-odbc-result branch March 8, 2024 09:15
@alexander-beedie alexander-beedie added the A-io-database Area: reading/writing to databases label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-database Area: reading/writing to databases fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read_database errors on read from an empty table
2 participants