Skip to content

Commit c44e98c

Browse files
Fix PyPI package name and add Azure URL examples (#6)
* Initial commit Signed-off-by: teodordelibasic-db <[email protected]> * Fix formatting Signed-off-by: teodordelibasic-db <[email protected]> --------- Signed-off-by: teodordelibasic-db <[email protected]>
1 parent 9b0adc0 commit c44e98c

File tree

5 files changed

+124
-214
lines changed

5 files changed

+124
-214
lines changed

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ https://<databricks-instance>.cloud.databricks.com/o=<workspace-id>
6969
- **Workspace URL**: The part before `/o=``https://<databricks-instance>.cloud.databricks.com`
7070
- **Workspace ID**: The part after `/o=``<workspace-id>`
7171

72+
> **Note:** The examples above show AWS endpoints (`.cloud.databricks.com`). For Azure deployments, the workspace URL will be `https://<databricks-instance>.azuredatabricks.net`.
73+
7274
Example:
7375
- Full URL: `https://dbc-a1b2c3d4-e5f6.cloud.databricks.com/o=1234567890123456`
7476
- Workspace URL: `https://dbc-a1b2c3d4-e5f6.cloud.databricks.com`
@@ -119,7 +121,7 @@ GRANT SELECT, MODIFY ON TABLE <catalog_name>.default.air_quality TO `<service-pr
119121
Install the latest stable version using pip:
120122

121123
```bash
122-
pip install databricks-zerobus-ingest
124+
pip install databricks-zerobus-ingest-sdk
123125
```
124126

125127
#### From Source
@@ -175,7 +177,7 @@ python -m zerobus.tools.generate_proto \
175177
```
176178

177179
**Parameters:**
178-
- `--uc-endpoint`: Your workspace URL (e.g., `https://dbc-a1b2c3d4-e5f6.cloud.databricks.com`)
180+
- `--uc-endpoint`: Your workspace URL (e.g., `https://dbc-a1b2c3d4-e5f6.cloud.databricks.com` for AWS, or `https://dbc-a1b2c3d4-e5f6.azuredatabricks.net` for Azure)
179181
- `--client-id`: Service principal application ID
180182
- `--client-secret`: Service principal secret
181183
- `--table`: Fully qualified table name (catalog.schema.table)
@@ -253,8 +255,14 @@ logging.basicConfig(
253255
)
254256

255257
# Configuration
258+
259+
# For AWS:
256260
server_endpoint = "1234567890123456.zerobus.us-west-2.cloud.databricks.com"
257261
workspace_url = "https://dbc-a1b2c3d4-e5f6.cloud.databricks.com"
262+
# For Azure:
263+
# server_endpoint = "1234567890123456.zerobus.us-west-2.azuredatabricks.net"
264+
# workspace_url = "https://dbc-a1b2c3d4-e5f6.azuredatabricks.net"
265+
258266
table_name = "main.default.air_quality"
259267
client_id = "your-service-principal-application-id"
260268
client_secret = "your-service-principal-secret"
@@ -285,7 +293,7 @@ try:
285293
)
286294

287295
ack = stream.ingest_record(record)
288-
ack.wait_for_ack() # Wait for durability
296+
ack.wait_for_ack() # Optional: Wait for durability confirmation
289297

290298
print(f"Ingested record {i + 1}")
291299

@@ -311,8 +319,15 @@ logging.basicConfig(
311319

312320
async def main():
313321
# Configuration
322+
323+
# For AWS:
314324
server_endpoint = "1234567890123456.zerobus.us-west-2.cloud.databricks.com"
315325
workspace_url = "https://dbc-a1b2c3d4-e5f6.cloud.databricks.com"
326+
327+
# For Azure:
328+
# server_endpoint = "1234567890123456.zerobus.us-west-2.azuredatabricks.net"
329+
# workspace_url = "https://dbc-a1b2c3d4-e5f6.azuredatabricks.net"
330+
316331
table_name = "main.default.air_quality"
317332
client_id = "your-service-principal-application-id"
318333
client_secret = "your-service-principal-secret"
@@ -343,7 +358,7 @@ async def main():
343358
)
344359

345360
future = await stream.ingest_record(record)
346-
await future # Wait for durability
361+
await future # Optional: Wait for durability confirmation
347362

348363
print(f"Ingested record {i + 1}")
349364

@@ -374,7 +389,7 @@ To run the examples, set your credentials as environment variables and execute t
374389

375390
### Blocking Ingestion
376391

377-
Ingest records synchronously, waiting for each record to be acknowledged:
392+
Ingest records using the synchronous API:
378393

379394
```python
380395
import logging
@@ -402,14 +417,14 @@ try:
402417
)
403418

404419
ack = stream.ingest_record(record)
405-
ack.wait_for_ack() # Wait for durability
420+
ack.wait_for_ack() # Optional: Wait for durability confirmation
406421
finally:
407422
stream.close()
408423
```
409424

410425
### Non-Blocking Ingestion
411426

412-
Ingest records asynchronously for maximum throughput:
427+
Ingest records using the asynchronous API:
413428

414429
```python
415430
import asyncio
@@ -537,7 +552,7 @@ sdk = ZerobusSdk(server_endpoint, unity_catalog_endpoint)
537552
```
538553

539554
**Constructor Parameters:**
540-
- `server_endpoint` (str) - The Zerobus gRPC endpoint (e.g., `<workspace-id>.zerobus.region.cloud.databricks.com`)
555+
- `server_endpoint` (str) - The Zerobus gRPC endpoint (e.g., `<workspace-id>.zerobus.<region>.cloud.databricks.com` for AWS, or `<workspace-id>.zerobus.<region>.azuredatabricks.net` for Azure)
541556
- `unity_catalog_endpoint` (str) - The Unity Catalog endpoint (your workspace URL)
542557

543558
**Methods:**

0 commit comments

Comments
 (0)