Fivetran Async Provider for Apache Airflow

2.3.0 · active · verified Wed Apr 15

The `airflow-provider-fivetran-async` library provides asynchronous operators, sensors, and hooks for integrating Fivetran with Apache Airflow. It leverages Airflow's deferrable tasks to efficiently orchestrate Fivetran data synchronization jobs, freeing up worker slots during I/O-bound waiting periods. This provider is actively maintained by Astronomer and Fivetran, with the current stable version being 2.3.0 and regular releases, including alpha versions for upcoming features and breaking changes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a simple Airflow DAG using the `FivetranOperator` (referred to as `FivetranOperatorAsync` in docs) to trigger and monitor a Fivetran sync. Before running, configure an Airflow connection named `fivetran_default` with your Fivetran API Key and Secret.

import os
from datetime import datetime
from airflow.decorators import dag
from fivetran_provider_async.operators import FivetranOperator

FIVETRAN_API_KEY = os.environ.get('FIVETRAN_API_KEY', 'your_fivetran_api_key')
FIVETRAN_API_SECRET = os.environ.get('FIVETRAN_API_SECRET', 'your_fivetran_api_secret')
FIVETRAN_CONNECTOR_ID = os.environ.get('FIVETRAN_CONNECTOR_ID', 'your_connector_id')

@dag(
    dag_id='fivetran_async_sync_example',
    start_date=datetime(2023, 1, 1),
    schedule=None,
    catchup=False,
    tags=['fivetran', 'async', 'etl']
)
def fivetran_async_dag():
    # Configure Fivetran connection in Airflow UI (Admin -> Connections)
    # Conn Id: fivetran_default
    # Conn Type: Fivetran
    # Login (API Key): FIVETRAN_API_KEY
    # Password (API Secret): FIVETRAN_API_SECRET

    start_fivetran_sync = FivetranOperator(
        task_id='start_fivetran_sync',
        fivetran_conn_id='fivetran_default',
        connector_id=FIVETRAN_CONNECTOR_ID,
        deferrable=True, # This is the default behavior
        wait_for_completion=True # This is the default behavior
    )

fivetran_async_dag()

view raw JSON →