Skip to main content

Apache airflow provider for managing Reverse ETL syncs and Profiles runs in RudderStack.

Project description

The Customer Data Platform for Developers

Website · Slack Community


RudderStack Airflow Provider

The RudderStack Airflow Provider lets you programmatically schedule and trigger your Reverse ETL syncs and Profiles runs outside RudderStack and integrate them with your existing Airflow workflows. Refer to orchestration docs.

Installation

pip install rudderstack-airflow-provider

Usage

RudderstackRETLOperator

[!NOTE]
Use RudderstackRETLOperator for reverse ETL connections

A simple DAG for triggering syncs for a RudderStack Reverse ETL source:

with DAG(
    "rudderstack-retl-sample",
    default_args=default_args,
    description="A simple tutorial DAG for reverse etl",
    schedule_interval=timedelta(days=1),
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=["rs-retl"],
) as dag:
    # retl_connection_id, sync_type are template fields
    rs_operator = RudderstackRETLOperator(
        retl_connection_id="connection_id",
        task_id="<a unique, meaningful id for the airflow task>",
        connection_id="<rudderstack api airflow connection id>"
    )

For the complete code, refer to this example.

Mandatatory parameters for RudderstackRETLOperator:

  • retl_connection_id: This is the connection id for the sync job.
  • connection_id: The Airflow connection to use for connecting to the Rudderstack API. Default value is rudderstack_default.

RudderstackRETLOperator exposes other configurable parameters as well. Mostly default values for them would be recommended.

  • request_max_retries: The maximum number of times requests to the RudderStack API should be retried before failng.
  • request_retry_delay: Time (in seconds) to wait between each request retry.
  • request_timeout: Time (in seconds) after which the requests to RudderStack are declared timed out.
  • poll_interval: Time (in seconds) for polling status of triggered job.
  • poll_timeout: Time (in seconds) after which the polling for a triggered job is declared timed out.
  • wait_for_completion: Boolean if execution run should poll and wait till completion of sync. Default value is True.
  • sync_type: Type of sync to trigger incremental or full. Default is None as RudderStack will be deteriming sync type.

RudderstackProfilesOperator

RudderstackProfilesOperator can be used to trigger profiles run. A simple DAG for triggering profile runs for a profiles project.

with DAG(
    "rudderstack-profiles-sample",
    default_args=default_args,
    description="A simple tutorial DAG for profiles run.",
    schedule_interval=timedelta(days=1),
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=["rs-profiles"],
) as dag:
    # profile_id is template field
    rs_operator = RudderstackProfilesOperator(
        profile_id="<profile_id>",
        task_id="<a unique, meaningful id for the airflow task",
        connection_id="<rudderstack api connection id>",
    )

Mandatatory parameters for RudderstackProfilesOperator:

  • profile_id: This is the profiles id for the profiles project to run.
  • connection_id: The Airflow connection to use for connecting to the Rudderstack API. Default value is rudderstack_default.

RudderstackProfilesOperator exposes other configurable parameters as well. Mostly default values for them would be recommended.

  • request_max_retries: The maximum number of times requests to the RudderStack API should be retried before failng.
  • request_retry_delay: Time (in seconds) to wait between each request retry.
  • request_timeout: Time (in seconds) after which the requests to RudderStack are declared timed out.
  • poll_interval: Time (in seconds) for polling status of triggered job.
  • poll_timeout: Time (in seconds) after which the polling for a triggered job is declared timed out.
  • wait_for_completion: Boolean if execution run should poll and wait till completion of sync. Default value is True.
  • parameters: Additional parameters to pass to the profiles run command, as supported by the API endpoint. Default value is None.

Contribute

We would love to see you contribute to this project. Get more information on how to contribute here.

License

The RudderStack Airflow Provider is released under the MIT License.

Contact Us

For more information or queries on this feature, you can contact us or start a conversation in our Slack community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rudderstack_airflow_provider-2.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rudderstack_airflow_provider-2.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file rudderstack_airflow_provider-2.1.1.tar.gz.

File metadata

File hashes

Hashes for rudderstack_airflow_provider-2.1.1.tar.gz
Algorithm Hash digest
SHA256 e31df7d14041b96b5d46a34e926e7c105df3c12c59a09ec6d10e17fd5877efa8
MD5 d8ab3f9d4ac16cb2043bb7cac72f5d5b
BLAKE2b-256 e1b2ac4fbde87fcc7e82eedc2c9868dca07f457fe28c4574b92828b41268960b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rudderstack_airflow_provider-2.1.1.tar.gz:

Publisher: release.yaml on rudderlabs/rudder-airflow-provider

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rudderstack_airflow_provider-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rudderstack_airflow_provider-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 afc29d85dd74e9c205ab0b5d96c76b1a94716360231e5bca8cd23cf9e59d3faa
MD5 eadf4e57315dd7c86d66f606e80c4674
BLAKE2b-256 bbf7254052c62360dcc7f1c62ba93984f2b8efa1a22bb06759349ddcb0a77895

See more details on using hashes here.

Provenance

The following attestation bundles were made for rudderstack_airflow_provider-2.1.1-py3-none-any.whl:

Publisher: release.yaml on rudderlabs/rudder-airflow-provider

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page