mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-23 06:50:40 +00:00
1. Use generated models in lance-namespace for request response models to avoid multiple layers of conversions 2. Make sure the API is consistent with the namespace spec 3. Deprecate the table_names API in favor of the list_tables API in namespace that allows full pagination support without the need to have sorted table names 4. Add describe_namespace API which was a miss in the original implementation
28 lines
855 B
Python
28 lines
855 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
|
|
"""Utility functions for namespace operations."""
|
|
|
|
from typing import Optional
|
|
|
|
|
|
def _normalize_create_namespace_mode(mode: Optional[str]) -> Optional[str]:
|
|
"""Normalize create namespace mode to lowercase (API expects lowercase)."""
|
|
if mode is None:
|
|
return None
|
|
return mode.lower()
|
|
|
|
|
|
def _normalize_drop_namespace_mode(mode: Optional[str]) -> Optional[str]:
|
|
"""Normalize drop namespace mode to uppercase (API expects uppercase)."""
|
|
if mode is None:
|
|
return None
|
|
return mode.upper()
|
|
|
|
|
|
def _normalize_drop_namespace_behavior(behavior: Optional[str]) -> Optional[str]:
|
|
"""Normalize drop namespace behavior to uppercase (API expects uppercase)."""
|
|
if behavior is None:
|
|
return None
|
|
return behavior.upper()
|