2021-12-10 17:41:08 +03:00
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
|
|
from airflow import DAG
|
2024-02-21 19:51:16 +03:00
|
|
|
from fivetran_provider_async.operators import FivetranOperator
|
|
|
|
|
2022-01-06 21:13:55 +03:00
|
|
|
from utils.tags import Tag
|
2021-12-10 17:41:08 +03:00
|
|
|
|
|
|
|
DOCS = """
|
|
|
|
### fivetran_casa
|
|
|
|
|
2022-01-06 21:13:55 +03:00
|
|
|
#### Description
|
2021-12-10 17:41:08 +03:00
|
|
|
|
2022-01-06 21:13:55 +03:00
|
|
|
This DAG triggers Fivetran to import data from CASA using the
|
2021-12-10 17:41:08 +03:00
|
|
|
[casa connector](https://github.com/mozilla/fivetran-connectors/tree/main/connectors/casa).
|
|
|
|
|
|
|
|
#### Owner
|
|
|
|
|
|
|
|
anicholson@mozilla.com
|
|
|
|
"""
|
|
|
|
|
|
|
|
default_args = {
|
|
|
|
"owner": "anicholson@mozilla.com",
|
|
|
|
"email": ["anicholson@mozilla.com"],
|
|
|
|
"depends_on_past": False,
|
|
|
|
"start_date": datetime(2021, 12, 10),
|
|
|
|
"email_on_failure": True,
|
|
|
|
"email_on_retry": True,
|
|
|
|
"retries": 2,
|
|
|
|
"retry_delay": timedelta(minutes=30),
|
|
|
|
}
|
|
|
|
|
2022-01-06 21:13:55 +03:00
|
|
|
tags = [Tag.ImpactTier.tier_1]
|
|
|
|
|
|
|
|
with DAG(
|
2024-02-21 19:51:16 +03:00
|
|
|
"fivetran_casa",
|
2022-01-06 21:13:55 +03:00
|
|
|
default_args=default_args,
|
|
|
|
doc_md=DOCS,
|
|
|
|
schedule_interval="0 5 * * *",
|
2022-01-14 15:04:32 +03:00
|
|
|
tags=tags,
|
2022-01-06 21:13:55 +03:00
|
|
|
) as dag:
|
2021-12-10 17:41:08 +03:00
|
|
|
casa_sync_start = FivetranOperator(
|
2024-02-21 19:51:16 +03:00
|
|
|
connector_id="{{ var.value.fivetran_casa_connector_id }}",
|
|
|
|
task_id="casa-task",
|
2024-03-01 01:10:53 +03:00
|
|
|
deferrable=False,
|
2024-02-21 22:56:22 +03:00
|
|
|
task_concurrency=1,
|
2021-12-10 17:41:08 +03:00
|
|
|
)
|