Skip to content

Commit

Permalink
update AirbyteConnection docstring example for UI
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Dec 28, 2022
1 parent 25d29f5 commit 7664891
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions prefect_airbyte/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,20 +284,25 @@ class AirbyteConnection(JobBlock):
status_updates: Whether to log job status on each poll of the Airbyte sync job.
timeout: Timeout in seconds for requests made by `httpx.AsyncClient`.
Example:
Examples:
Load an existing `AirbyteConnection` block:
```python
from prefect_airbyte import AirbyteConnection
airbyte_connection = AirbyteConnection.load("BLOCK_NAME")
```
# trigger the Airbyte connection sync
airbyte_sync = airbyte_connection.trigger()
Run an Airbyte connection sync as a flow:
```python
from prefect import flow
from prefect_airbyte import AirbyteConnection
from prefect_airbyte.flows import run_connection_sync # this is a flow
# wait for the Airbyte sync to complete
airbyte_sync.wait_for_completion()
airbyte_connection = AirbyteConnection.load("BLOCK_NAME")
# fetch the result of the Airbyte sync
airbyte_sync_result = airbyte_sync.fetch_result()
@flow
def airbyte_orchestrator():
run_connection_sync(airbyte_connection) # now it's a subflow
```
"""

Expand Down

0 comments on commit 7664891

Please sign in to comment.