Skip to content

Add missing imports for Python bindings - #342

Merged
CGodiksen merged 3 commits into
mainfrom
bug/private-python-api
Aug 11, 2025
Merged

Add missing imports for Python bindings#342
CGodiksen merged 3 commits into
mainfrom
bug/private-python-api

Conversation

@CGodiksen

Copy link
Copy Markdown
Collaborator

This PR fixes a small bug in the Python bindings that was caused by the convenience functions not being imported in the __init__.py file from operations.py. With this PR it should now be possible to use both modelardb.Operations.open_local() and modelardb.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.

@CGodiksen CGodiksen self-assigned this Aug 10, 2025
@CGodiksen
CGodiksen requested a review from Copilot August 10, 2025 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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__.py to expose convenience functions like open_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::iter import is being removed but it's still used elsewhere in the file. Verify that iter is imported in the combined import on line 27 to avoid compilation errors.
use std::ops::Range;

@CGodiksen
CGodiksen merged commit 1c5194f into main Aug 11, 2025
4 checks passed
@CGodiksen
CGodiksen deleted the bug/private-python-api branch August 11, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants