diff --git a/CHANGELOG.md b/CHANGELOG.md index d70f74e..8930ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Frontend fetch calls now check `response.ok` before parsing JSON, so HTTP error responses surface as error states instead of being parsed as data (#27). - `/rows` with unknown column names and `/vector/preview` with a missing or non-vector column now return 400 as intended; the error was previously masked as a generic 500 (#28). +- `/datasets` uses `list_tables()` on lancedb versions that have it, falling back to the deprecated `table_names()` on older ones (#54). ### Docs - README refresh: corrected the supported-data-types section (variable-length float vectors render fully since #14; no 2048-dimension limit), documented the release image tags from #46, added test suite instructions, made 0.29.2 the recommendation throughout, and linked CONTRIBUTING.md and CHANGELOG.md (#51). diff --git a/backend/app.py b/backend/app.py index e399d54..288c50f 100644 --- a/backend/app.py +++ b/backend/app.py @@ -174,7 +174,12 @@ async def health_check(): async def list_datasets(): try: db = get_lance_connection() - table_names = db.table_names() + if hasattr(db, "list_tables"): + table_names = db.list_tables().tables + else: + # table_names() was deprecated in favor of list_tables(), + # but older lancedb versions only have table_names() + table_names = db.table_names() valid_tables = [name for name in table_names if validate_dataset_name(name)] return {"datasets": valid_tables} except Exception as e: