How to use the flowetl.util.create_dag function in flowetl

To help you get started, we’ve selected a few flowetl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flowminder / FlowKit / flowetl / deployment_example / mounts / dags / sms.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""
Test dags for use in integration tests.
"""

from datetime import datetime, timedelta

from airflow import DAG
from flowetl.util import create_dag

dag = create_dag(
    dag_id="sms",
    schedule_interval="@daily",
    retries=0,
    retry_delay=timedelta(days=1),
    start_date=datetime(2019, 1, 1),
    end_date=datetime(2019, 1, 2),
    cdr_type="sms",
    data_present_poke_interval=5,
    flux_check_poke_interval=5,
    flux_check_wait_interval=5,
    extract_sql="extract_sms.sql",
    indexes=["msisdn_counterpart", "location_id", "datetime", "tac"],
    cluster_field="msisdn",
    filename="/mounts/files/{{ params.cdr_type.upper() }}_{{ ds_nodash }}.csv",
    fields={"msisdn": "TEXT", "event_time": "TIMESTAMPTZ", "cell_id": "TEXT",},
    null="Undefined",
github Flowminder / FlowKit / flowetl / mounts / dags / remote_table_dag.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""
Test dags for use in integration tests.
"""

from datetime import datetime, timedelta

from airflow import DAG
from flowetl.util import create_dag

dag = create_dag(
    dag_id="remote_table_dag",
    schedule_interval=None,
    retries=0,
    retry_delay=timedelta(days=1),
    start_date=datetime(2016, 6, 15),
    end_date=datetime(2016, 6, 17),
    cdr_type="calls",
    source_table="events.sample",
    staging_view_sql="create_staging_view.sql",
    data_present_poke_interval=5,
    flux_check_poke_interval=5,
    flux_check_wait_interval=5,
    extract_sql="extract.sql",
    indexes=["msisdn", "location_id", "datetime"],
)
dag.is_paused_upon_creation = False
github Flowminder / FlowKit / flowetl / mounts / dags / filesystem_dag.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""
Test dags for use in integration tests.
"""

from datetime import datetime, timedelta

from airflow import DAG
from flowetl.util import create_dag

dag = create_dag(
    dag_id="filesystem_dag",
    schedule_interval=None,
    retries=0,
    retry_delay=timedelta(days=1),
    start_date=datetime(2016, 3, 1),
    end_date=datetime(2016, 6, 17),
    cdr_type="calls",
    data_present_poke_interval=5,
    flux_check_poke_interval=5,
    flux_check_wait_interval=5,
    extract_sql="extract.sql",
    indexes=["msisdn_counterpart", "location_id", "datetime", "tac"],
    cluster_field="msisdn",
    program="zcat",
    filename="/files/{{ params.cdr_type }}_{{ ds_nodash }}.csv.gz",
    fields={"msisdn": "TEXT", "cell_id": "TEXT", "event_time": "TIMESTAMPTZ",},