Add missing imports for Python bindings - #342
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes Python bindings imports to enable direct access to convenience functions and addresses various Clippy code style issues throughout the Rust codebase.
- Adds missing imports in Python bindings
__init__.pyto expose convenience functions likeopen_local() - Refactors nested if-let statements to use let-chains pattern for better readability
- Replaces slice creation patterns with
slice::from_ref()for single element slices
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/modelardb_embedded/bindings/python/modelardb/init.py | Adds missing convenience function imports to fix Python binding access |
| crates/modelardb_storage/src/query/normal_table.rs | Adds explicit lifetime parameter to Cow type |
| crates/modelardb_storage/src/query/grid_exec.rs | Uses slice::from_ref() for single element slice creation |
| crates/modelardb_storage/src/parser.rs | Refactors nested if-let statements to let-chains pattern |
| crates/modelardb_storage/src/optimizer/model_simple_aggregates.rs | Simplifies nested conditionals using let-chains |
| crates/modelardb_server/tests/integration_test.rs | Replaces single-element array references with slice::from_ref() |
| crates/modelardb_bulkloader/src/main.rs | Combines conditional check with error handling using let-chains |
Comments suppressed due to low confidence (1)
crates/modelardb_server/tests/integration_test.rs:20
- The
std::iterimport is being removed but it's still used elsewhere in the file. Verify thatiteris imported in the combined import on line 27 to avoid compilation errors.
use std::ops::Range;
chrthomsen
approved these changes
Aug 11, 2025
skejserjensen
approved these changes
Aug 11, 2025
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 fixes a small bug in the Python bindings that was caused by the convenience functions not being imported in the
__init__.pyfile fromoperations.py. With this PR it should now be possible to use bothmodelardb.Operations.open_local()andmodelardb.open_local().Note that most of the changes are from Clippy issues. The relevant change that fixes the bug is in
crates/modelardb_embedded/bindings/python/modelardb/__init__.py.