chore: suppress deprecation wwarning from 'lancedb'
This commit is contained in:
parent
7696b3f98f
commit
53481a7d7a
3 changed files with 9 additions and 9 deletions
|
|
@ -79,7 +79,7 @@ class InfoModal(ModalScreen):
|
|||
# Connect to get table info
|
||||
try:
|
||||
db = lancedb.connect(self.db_path)
|
||||
table_names = set(db.table_names())
|
||||
table_names = set(db.list_tables().tables)
|
||||
except Exception as e:
|
||||
lines.append(f"[red]Failed to open database: {e}[/red]")
|
||||
self._content_widget.update("\n".join(lines))
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class Store:
|
|||
The stored vector dimension, or None if not found.
|
||||
"""
|
||||
try:
|
||||
existing_tables = self.db.table_names()
|
||||
existing_tables = self.db.list_tables().tables
|
||||
if "settings" not in existing_tables:
|
||||
return None
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ class Store:
|
|||
|
||||
def _init_tables(self):
|
||||
"""Initialize database tables (create if they don't exist)."""
|
||||
existing_tables = self.db.table_names()
|
||||
existing_tables = self.db.list_tables().tables
|
||||
required_tables = {"documents", "chunks", "settings"}
|
||||
missing_tables = required_tables - set(existing_tables)
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
|
||||
if not ids:
|
||||
# Check if there's a staging table from a failed migration to recover from
|
||||
if "documents_v4_staging" in store.db.table_names():
|
||||
if "documents_v4_staging" in store.db.list_tables().tables:
|
||||
staging_table = store.db.open_table("documents_v4_staging")
|
||||
staging_ids = [
|
||||
row["id"]
|
||||
|
|
@ -100,7 +100,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
)
|
||||
# Create new documents table and copy from staging
|
||||
store.documents_table = None
|
||||
if "documents" in store.db.table_names():
|
||||
if "documents" in store.db.list_tables().tables:
|
||||
store.db.drop_table("documents")
|
||||
store.documents_table = store.db.create_table(
|
||||
"documents", schema=get_documents_arrow_schema_v4()
|
||||
|
|
@ -142,7 +142,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
|
||||
# No documents and no staging to recover, just recreate table with new schema
|
||||
store.documents_table = None
|
||||
if "documents" in store.db.table_names():
|
||||
if "documents" in store.db.list_tables().tables:
|
||||
store.db.drop_table("documents")
|
||||
store.documents_table = store.db.create_table(
|
||||
"documents", schema=get_documents_arrow_schema_v4()
|
||||
|
|
@ -150,7 +150,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
return
|
||||
|
||||
# Create staging table with new schema
|
||||
if "documents_v4_staging" in store.db.table_names():
|
||||
if "documents_v4_staging" in store.db.list_tables().tables:
|
||||
store.db.drop_table("documents_v4_staging")
|
||||
staging_table = store.db.create_table(
|
||||
"documents_v4_staging", schema=get_documents_arrow_schema_v4()
|
||||
|
|
@ -185,7 +185,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
|
||||
# Replace old table with staging table
|
||||
store.documents_table = None
|
||||
if "documents" in store.db.table_names():
|
||||
if "documents" in store.db.list_tables().tables:
|
||||
store.db.drop_table("documents")
|
||||
store.documents_table = store.db.create_table(
|
||||
"documents", schema=get_documents_arrow_schema_v4()
|
||||
|
|
@ -225,7 +225,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover
|
|||
logger.info("Copied batch %d/%d", batch_num, total_batches)
|
||||
|
||||
# Cleanup staging table
|
||||
if "documents_v4_staging" in store.db.table_names():
|
||||
if "documents_v4_staging" in store.db.list_tables().tables:
|
||||
store.db.drop_table("documents_v4_staging")
|
||||
|
||||
# Vacuum all tables (destructive migration, no history preserved)
|
||||
|
|
|
|||
Loading…
Reference in a new issue