Skip to content

Conversation

@fresh-borzoni
Copy link
Contributor

@fresh-borzoni fresh-borzoni commented Jan 11, 2026

Adds two missing admin operations to achieve feature parity with C++ bindings:

1. Admin.drop_table(table_path, ignore_if_not_exists=False)
   - Drop a table from the cluster
   - Optional flag to ignore if table doesn't exist

2. Admin.list_offsets(table_path, bucket_ids, offset_type, timestamp=None)
   - List offsets for specified buckets
   - offset_type: 0=Earliest, 1=Latest, 2=Timestamp
   - Returns dict[int, int] mapping bucket_id to offset

Implementation follows existing patterns from create_table() and matches
C++ bindings logic. Both core APIs already existed in admin.rs.

Closes #148

Copy link

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 adds two administrative operations to the Python bindings to achieve feature parity with C++ bindings: drop_table() for deleting tables and list_offsets() for querying bucket offsets. Both methods follow existing async patterns and leverage core APIs that already exist in the Rust codebase.

Changes:

  • Added Admin.drop_table() method with optional ignore_if_not_exists parameter
  • Added Admin.list_offsets() method supporting earliest, latest, and timestamp-based offset queries
  • Introduced OffsetType class with string constants for type-safe offset type specification
  • Updated example.py to demonstrate both new features

Reviewed changes

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

File Description
bindings/python/src/lib.rs Adds OffsetType class definition with string constants and registers it in the Python module
bindings/python/src/admin.rs Implements drop_table() and list_offsets() admin methods with validation and error handling
bindings/python/example/example.py Demonstrates usage of new methods with both string literals and OffsetType constants

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


let core_table_path = table_path.to_core().clone();
let core_table_path = table_path.to_core();
let core_descriptor = table_descriptor.to_core().clone();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here it's needed, it's reference

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.

Support drop_table and list_offsets methods in python bindings

1 participant