Last active
January 10, 2022 04:59
-
-
Save andreaschandra/6db9a914447717bae3c56031f0bce8df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import airflow | |
from airflow import DAG | |
from custom import MySqlToPostgreOperator | |
dag = DAG( | |
dag_id="job_trial_user", | |
start_date=datetime.today() - timedelta(days=1), | |
schedule_interval="0 */4 * * *", | |
concurrency=100 | |
) | |
start = MySqlToPostgreOperator( | |
task_id=f"start", | |
sql="select * from user " | |
"where created_at BETWEEN '{start_date}' " | |
"AND '{end_date}'", | |
target_table='public.user', | |
identifier='id', | |
dag=dag, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment