Remove workaround for schema() in C-API#380
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the prior C-API workaround for retrieving a table schema (returning an empty RecordBatch) and instead exports the schema directly via the Arrow C Data Interface, addressing the intermittent PyArrow import failure described in #316.
Changes:
- Update the embedded C-API
modelardb_embedded_schemato write directly to anArrowSchema*(no emptyRecordBatch). - Update the Python bindings to call the new C-API signature and import the schema via
Schema._import_from_c.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/modelardb_embedded/src/capi.rs | Simplifies schema export to write an FFI_ArrowSchema directly to the provided pointer. |
| crates/modelardb_embedded/bindings/python/modelardb/operations.py | Updates the cffi signature and schema() implementation to import from an ArrowSchema* pointer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
skejserjensen
approved these changes
Mar 18, 2026
chrthomsen
approved these changes
Mar 19, 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.
This PR closes #316 by removing the workaround implemented due to the bug described in that issue and testing that it works without the workaround. Instead of creating an empty record batch to return just the schema, we now just write the schema to a schema pointer.
It should be noted that it is unclear what the difference is between this implementation and the implementation that caused the bug in the first place. Most likely, the bug was fixed by an update in
pyarrowor one of our other dependencies. However, the steps to reproduce the bug described in #316 have been followed and the tests have been run repeatedly to ensure the bug is fixed.