databricks-tellr 0.3.10.dev2__tar.gz → 0.3.10.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: databricks-tellr
3
- Version: 0.3.10.dev2
3
+ Version: 0.3.10.dev4
4
4
  Summary: Tellr deployment tooling for Databricks Apps
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1474,6 +1474,36 @@ def _get_app_client_id(app: App) -> str | None:
1474
1474
  return None
1475
1475
 
1476
1476
 
1477
+ def _resolve_production_endpoint(
1478
+ ws: WorkspaceClient, project_name: str, branch_name: str = "production",
1479
+ ) -> dict[str, Any]:
1480
+ """Resolve an autoscaling branch's host + endpoint_name for a psycopg2 connect.
1481
+
1482
+ Returns a dict shaped like _get_or_create_lakebase()'s autoscaling result so
1483
+ it can be passed straight to _get_lakebase_connection(..., lakebase_result=...).
1484
+ """
1485
+ branch_path = f"projects/{project_name}/branches/{branch_name}"
1486
+ endpoints = list(ws.postgres.list_endpoints(parent=branch_path))
1487
+ ready = next(
1488
+ (
1489
+ e for e in endpoints
1490
+ if getattr(e, "status", None)
1491
+ and getattr(e.status, "hosts", None)
1492
+ and getattr(e.status.hosts, "host", None)
1493
+ ),
1494
+ None,
1495
+ )
1496
+ if not ready:
1497
+ raise DeploymentError(
1498
+ f"no ready endpoint for {branch_path} in project {project_name}"
1499
+ )
1500
+ return {
1501
+ "type": "autoscaling",
1502
+ "host": ready.status.hosts.host,
1503
+ "endpoint_name": ready.name,
1504
+ }
1505
+
1506
+
1477
1507
  def _get_lakebase_connection(
1478
1508
  ws: WorkspaceClient, lakebase_name: str, lakebase_result: dict[str, Any] | None = None,
1479
1509
  ) -> tuple[Any, str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: databricks-tellr
3
- Version: 0.3.10.dev2
3
+ Version: 0.3.10.dev4
4
4
  Summary: Tellr deployment tooling for Databricks Apps
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "databricks-tellr"
7
- version = "0.3.10.dev2"
7
+ version = "0.3.10.dev4"
8
8
  description = "Tellr deployment tooling for Databricks Apps"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"