Skip to content

Commit ea3ca2d

Browse files
committed
fix: rename create_managed_database param description→name; update stale docstrings
1 parent 1511b1b commit ea3ca2d

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/ibis_hotdata/backend.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def _resolve_connection(self, name_or_id: str) -> dict[str, Any]:
337337
raise com.IbisError(f"Unknown Hotdata connection {name_or_id!r}")
338338

339339
def _find_managed_connection(self, name_or_id: str) -> dict[str, Any] | None:
340-
"""Look up a managed database by id or description.
340+
"""Look up a managed database by id or name.
341341
342342
Returns the detail dict if found, ``None`` if not found.
343343
Raises :class:`~ibis.common.exceptions.IbisError` on API failures.
@@ -347,7 +347,7 @@ def _find_managed_connection(self, name_or_id: str) -> dict[str, Any] | None:
347347
except HotdataAPIError as exc:
348348
if exc.status_code != 404:
349349
raise _ibis_err_from_hotdata(exc) from exc
350-
# Fall back to description scan
350+
# Fall back to name scan
351351
try:
352352
data = self._http.list_databases()
353353
except HotdataAPIError as exc:
@@ -361,7 +361,7 @@ def _find_managed_connection(self, name_or_id: str) -> dict[str, Any] | None:
361361
return None
362362

363363
def _resolve_managed_connection(self, name_or_id: str) -> dict[str, Any]:
364-
"""Resolve a managed database by id or description, returning its detail dict."""
364+
"""Resolve a managed database by id or name, returning its detail dict."""
365365
result = self._find_managed_connection(name_or_id)
366366
if result is None:
367367
raise com.IbisError(f"Unknown managed database {name_or_id!r}")
@@ -585,7 +585,7 @@ def create_database(
585585
raise com.UnsupportedOperationError(
586586
"Hotdata create_database creates a managed connection (catalog); catalog= is not supported"
587587
)
588-
# Check if a database with this description already exists.
588+
# Check if a database with this name already exists.
589589
# Use _find_managed_connection so API errors (5xx) propagate while
590590
# a plain not-found returns None and is handled below.
591591
existing = self._find_managed_connection(name)
@@ -594,7 +594,7 @@ def create_database(
594594
raise com.IbisInputError(f"Managed database {name!r} already exists")
595595
return
596596
try:
597-
self._http.create_managed_database(description=name, schema=schema, tables=list(tables or ()))
597+
self._http.create_managed_database(name=name, schema=schema, tables=list(tables or ()))
598598
except HotdataAPIError as exc:
599599
raise _ibis_err_from_hotdata(exc) from exc
600600

src/ibis_hotdata/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def get_database(self, database_id: str) -> dict[str, Any]:
195195

196196
def create_managed_database(
197197
self,
198-
description: str | None = None,
198+
name: str | None = None,
199199
*,
200200
schema: str = "public",
201201
tables: Sequence[str] = (),
@@ -209,7 +209,7 @@ def create_managed_database(
209209
tables=[DatabaseDefaultTableDecl(name=t) for t in tables],
210210
)
211211
]
212-
req = CreateDatabaseRequest(name=description, schemas=schemas)
212+
req = CreateDatabaseRequest(name=name, schemas=schemas)
213213
resp = self._safe_call(self._databases.create_database, req)
214214
return resp.model_dump(by_alias=True, mode="json")
215215

0 commit comments

Comments
 (0)