komal azram
07/04/2022, 6:21 AMAnna Geller
07/04/2022, 11:45 AMkomal azram
07/04/2022, 2:56 PMimport uuid
from time import sleep
from prefect import task
from prefect.logging.loggers import get_logger
from prefect_airbyte import exceptions as err
from prefect_airbyte.client import AirbyteClient
from prefect import flow
from prefect_airbyte.connections import trigger_sync
# Connection statuses
CONNECTION_STATUS_ACTIVE = "active"
CONNECTION_STATUS_INACTIVE = "inactive"
CONNECTION_STATUS_DEPRECATED = "deprecated"
# Job statuses
JOB_STATUS_SUCCEEDED = "succeeded"
JOB_STATUS_FAILED = "failed"
JOB_STATUS_PENDING = "pending"
@task
def trigger_sync():
airbyte_server_host: str = "localhost",
airbyte_server_port: int = "8000",
airbyte_api_version: str = "v1",
connection_id: str = None,
poll_interval_s: int = 15,
status_updates: bool = False
@flow
def example_trigger_sync_flow():
# Run other tasks and subflows here
trigger_sync(
connection_id="6788...")
example_trigger_sync_flow()
Anna Geller
07/04/2022, 5:37 PMfrom prefect import flow
from prefect_airbyte.connections import trigger_sync
@flow
def example_trigger_sync_flow():
# Run other tasks and subflows here
trigger_sync(
connection_id="your-connection-id-to-sync",
poll_interval_s=3,
status_updates=True
)
example_trigger_sync_flow()
komal azram
07/06/2022, 6:03 AMAnna Geller
07/06/2022, 2:01 PMkomal azram
07/06/2022, 2:57 PM