Repository navigation
Rename user-facing term "managed database" to "instant database" #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| (multi-column projections, joins across tables, filters, ordering) -- not | ||
| just a single trivial column. | ||
|
|
||
| Ad hoc/federated querying (raw ``Connection`` tables, no managed database) is | ||
| Ad hoc/federated querying (raw ``Connection`` tables, no instant database) is | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nit: (not blocking) Lines 2 and 5 of this same module docstring were missed:
L2 is the same term being renamed, so the file now reads "managed Hotdata database" in the summary line and "instant database" ten lines later. (L5's "managed tables" is arguably a separate term — your call.) |
||
| not used here: it's a deprecated path, and every query now requires a | ||
| database scope server-side regardless. | ||
|
|
||
|
|
@@ -40,7 +40,7 @@ | |
|
|
||
|
|
||
| def setup(api_url: str, token: str, workspace_id: str) -> str: | ||
| """Create the managed database and load small customer/orders tables.""" | ||
| """Create the instant database and load small customer/orders tables.""" | ||
| con = ibis.hotdata.connect(api_url=api_url, token=token, workspace_id=workspace_id) | ||
| database_id = con.create_database(DATABASE, tables=["customer", "orders"], schema=SCHEMA) | ||
|
|
||
|
|
@@ -120,7 +120,7 @@ def main() -> None: | |
| token = os.environ["HOTDATA_API_KEY"] | ||
| workspace_id = os.environ["HOTDATA_WORKSPACE"] | ||
|
|
||
| print("== SETUP (managed database: customer, orders) ==") | ||
| print("== SETUP (instant database: customer, orders) ==") | ||
| database_id = setup(API_BASE_URL, token, workspace_id) | ||
| print(f"created database_id={database_id}") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,7 +170,7 @@ def do_connect( | |
| Optional default **database** (remote schema name). If omitted and only | ||
| one schema exists for the default connection, it is chosen automatically. | ||
| database_id | ||
| Optional managed database id to bind at connect time. When set, all | ||
| Optional instant database id to bind at connect time. When set, all | ||
| queries use this database's ``X-Database-Id`` header and ``"default"`` | ||
| catalog references resolve to the underlying connection automatically — | ||
| without needing to call ``create_table`` first. | ||
|
|
@@ -335,7 +335,7 @@ def _resolve_connection(self, name_or_id: str) -> dict[str, Any]: | |
| raise com.IbisError(f"Unknown Hotdata connection {name_or_id!r}") | ||
|
|
||
| def _find_managed_connection(self, database_id: str) -> dict[str, Any] | None: | ||
| """Look up a managed database by id. | ||
| """Look up an instant database by id. | ||
|
|
||
| Returns the detail dict if found, ``None`` if not found. | ||
| Raises :class:`~ibis.common.exceptions.IbisError` on API failures. | ||
|
|
@@ -348,10 +348,10 @@ def _find_managed_connection(self, database_id: str) -> dict[str, Any] | None: | |
| raise _ibis_err_from_hotdata(exc) from exc | ||
|
|
||
| def _resolve_managed_connection(self, database_id: str) -> dict[str, Any]: | ||
| """Resolve a managed database by id, returning its detail dict.""" | ||
| """Resolve an instant database by id, returning its detail dict.""" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: (not blocking) The private helpers got renamed, but the two public API docstrings and their user-facing error messages still say "managed":
These are the most user-visible strings of the set (they show up in |
||
| result = self._find_managed_connection(database_id) | ||
| if result is None: | ||
| raise com.IbisError(f"Unknown managed database {database_id!r}") | ||
| raise com.IbisError(f"Unknown instant database {database_id!r}") | ||
| return result | ||
|
|
||
| def _managed_table_synced( | ||
|
|
@@ -399,15 +399,15 @@ def _table_location( | |
| db_record = self._resolve_managed_connection(conn) | ||
| conn_id = db_record["default_connection_id"] | ||
| # Always update both cached values so they stay in sync across multiple | ||
| # create_table / drop_table calls, even if different managed databases are used. | ||
| # create_table / drop_table calls, even if different instant databases are used. | ||
| self._database_id = db_record["id"] | ||
| self._database_connection_id = conn_id | ||
| return conn_id, schema | ||
|
|
||
| def _resolve_database_connection_id(self) -> str | None: | ||
| """Return the actual connection_id for the current managed database context. | ||
| """Return the actual connection_id for the current instant database context. | ||
|
|
||
| Managed database SQL uses ``"default"`` as the catalog, but the information | ||
| Instant database SQL uses ``"default"`` as the catalog, but the information | ||
| schema REST API still needs the real ``connection_id``. This method resolves | ||
| that mapping lazily and caches the result. | ||
| """ | ||
|
|
@@ -432,7 +432,7 @@ def get_schema( | |
| ) -> sch.Schema: | ||
| conn = catalog or self.current_catalog | ||
| schema_name = database or self.current_database | ||
| # Managed database tables use "default" as the SQL catalog but the info | ||
| # Instant database tables use "default" as the SQL catalog but the info | ||
| # schema REST API needs the real connection_id. | ||
| api_conn = ( | ||
| (self._resolve_database_connection_id() or conn) | ||
|
|
@@ -665,7 +665,7 @@ def create_table( | |
| ) -> ir.Table: | ||
| """Upload local data into a declared managed table. | ||
|
|
||
| ``database``'s first element must be the managed database id returned | ||
| ``database``'s first element must be the instant database id returned | ||
| by ``create_database``, not its display name — Hotdata database names | ||
| are not unique. | ||
|
|
||
|
|
@@ -679,7 +679,7 @@ def create_table( | |
| data = self._local_table_to_parquet(obj, schema) | ||
| connection_id, schema_name = self._table_location(database) | ||
| # Cache the resolved connection_id so get_schema can use it for info schema | ||
| # API calls when the "default" catalog is used in managed database contexts. | ||
| # API calls when the "default" catalog is used in instant database contexts. | ||
| self._database_connection_id = connection_id | ||
| if not overwrite and self._managed_table_synced(connection_id, schema_name, name): | ||
| raise com.IbisInputError( | ||
|
|
@@ -695,7 +695,7 @@ def create_table( | |
| ) | ||
| except HotdataAPIError as exc: | ||
| raise _ibis_err_from_hotdata(exc) from exc | ||
| # Managed database SQL requires "default" as the catalog prefix, not the | ||
| # Instant database SQL requires "default" as the catalog prefix, not the | ||
| # raw connection_id. _table_location always sets _database_id when resolving | ||
| # a managed connection, so we can always use the "default" catalog here. | ||
| return self.table(name, database=("default", schema_name)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: (not blocking)
README.md:263in the "What's supported" table still reads`create_database` / `drop_database` (managed). That parenthetical is prose, not an identifier, so it should probably become(instant)to match the new section heading.