feat(python): add namespace_client() method to connection classes

Add namespace_client() method that returns the equivalent namespace client
for different connection types:
- Native storage (LanceDBConnection): returns DirectoryNamespace
- Namespace connection: returns the backing namespace client
- Enterprise connection (RemoteDBConnection): returns RestNamespace

Implementation uses a hybrid approach:
- Rust side exposes namespace_client_config() returning (impl, properties)
- Python side uses lance_namespace.connect() to construct the namespace

Changes:
- Add namespace_client_config() to Database trait and implementations
- Add PyO3 binding for namespace_client_config()
- Add namespace_client() to DBConnection, LanceDBConnection, AsyncConnection
- Add namespace_client() to RemoteDBConnection
- Add namespace_client() to LanceNamespaceDBConnection and async variant
- Add tests for namespace_client() functionality
- Update pylance dependency to >=5.0.0b5

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
Jack Ye
2026-04-04 12:20:08 -07:00
parent 3bdb4a3db1
commit d60d78d611
12 changed files with 238 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ repository = "https://github.com/lancedb/lancedb"
[project.optional-dependencies]
pylance = [
"pylance>=5.0.0b3",
"pylance>=5.0.0b5",
]
tests = [
"aiohttp>=3.9.0",
@@ -59,7 +59,7 @@ tests = [
"polars>=0.19, <=1.3.0",
"tantivy>=0.20.0",
"pyarrow-stubs>=16.0",
"pylance>=5.0.0b3",
"pylance>=5.0.0b5",
"requests>=2.31.0",
"datafusion>=52,<53",
]