Compare commits

..

11 Commits

Author SHA1 Message Date
Jack Ye
d940b9ade7 commit 2026-04-12 12:58:14 -07:00
Jack Ye
d059447feb refactor: rename deserialize to deserialize_conn, consistent pushdown naming
- Rename deserialize() -> deserialize_conn() for clarity
- Rename internal _pushdown_operations -> _namespace_client_pushdown_operations
  for consistency with the parameter name
- Rename serialized key "pushdown_operations" ->
  "namespace_client_pushdown_operations"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
6427024bcb fix: route list_namespaces through _namespace_conn for consistency
list_namespaces with empty path was going through Rust (ListingDatabase)
which doesn't see namespaces created via the directory namespace client.
Always delegate to _namespace_conn() so create/list are consistent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
be19a880a9 fix: format, lint, and update tests for namespace delegation
- Run ruff format on all changed files
- Fix F821 forward reference in _namespace_conn return type
- Update test_local_namespace_operations to verify operations succeed
  instead of expecting NotImplementedError (namespace ops now work on
  LanceDBConnection via directory namespace delegation)
- Remove test_local_create_namespace_not_supported and
  test_local_drop_namespace_not_supported (no longer applicable)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
e7ed3d5dab fix: merge user storage_options in server-side create_table
_create_table_server_side was only passing self.storage_options
(connection-level) to CreateTableRequest, ignoring the user-provided
storage_options parameter. This caused per-table options like
new_table_data_storage_version to be silently dropped.

Fix both sync and async paths to merge user options on top of
connection options.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
7ed4b059a6 refactor: rename serialize_to_json/from_serialized_json to serialize/deserialize
Simpler names, docs no longer reference JSON as the serialization format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
f36583d0c3 fix: keep original Rust path for root namespace operations
Only delegate to _namespace_conn() when namespace_path is non-empty.
Root namespace operations (list_namespaces, list_tables with empty
path) still go through the original Rust connection to avoid regression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
fea2ef6a0a refactor: generalize worker property overrides with _lancedb_worker_ prefix
Replace the special-cased worker_uri key with a generic mechanism:
any namespace_client_properties key starting with _lancedb_worker_
has the prefix stripped and overrides the corresponding property
when for_worker=True.

e.g. _lancedb_worker_uri overrides uri in worker context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
fc2a9726b2 refactor: delegate child namespace ops to LanceNamespaceDBConnection
Instead of reimplementing namespace logic (describe_table, merge
storage_options, etc.) in LanceDBConnection, delegate child namespace
operations to a LanceNamespaceDBConnection via _namespace_conn().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
e3893dacf8 feat: cache namespace_client and auto-delegate child namespace operations
LanceDBConnection now:
- Caches namespace_client() result to avoid repeated DirectoryNamespace builds
- Auto-delegates open_table/create_table with non-empty namespace_path
  through the directory namespace client
- Routes create_namespace/drop_namespace/describe_namespace/list_namespaces
  through the namespace client
- Routes list_tables/drop_table for child namespaces through namespace client

This enables local storage connections to transparently handle child
namespaces like ["__system"] without requiring a separate
LanceNamespaceDBConnection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
Jack Ye
dd2a0ec48f feat: add serialize_to_json/from_serialized_json for DBConnection
Add serialization support to DBConnection classes so connections
can be reconstructed in remote workers without tracking namespace
params separately.

- DBConnection.serialize_to_json() base method
- LanceDBConnection: serializes uri, storage_options, read_consistency_interval
- LanceNamespaceDBConnection: stores namespace_client_impl/properties,
  serializes all connection params including pushdown_operations
- from_serialized_json() factory with for_worker flag for worker_uri swap
- connect_namespace() now passes impl/properties to connection for serialization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:58:14 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.31.0-beta.5"
current_version = "0.31.0-beta.4"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.

View File

@@ -1,6 +1,6 @@
[package]
name = "lancedb-python"
version = "0.31.0-beta.5"
version = "0.31.0-beta.4"
edition.workspace = true
description = "Python bindings for LanceDB"
license.workspace = true