File tree 2 files changed +34
-31
lines changed
airflow/dags/postgres_dags
2 files changed +34
-31
lines changed Original file line number Diff line number Diff line change
1
+ import json
2
+ import pathlib
3
+
4
+ import airflow
5
+ import requests
6
+ import requests .exceptions as requests_exceptions
7
+ from airflow import DAG
8
+ from airflow .operators .bash import BashOperator
9
+ from airflow .operators .python import PythonOperator
10
+ from airflow .providers .postgres .operators .postgres import PostgresOperator
11
+
12
+ import sys
13
+ import os
14
+
15
+ dag = DAG (
16
+ dag_id = "Load_traffic_data" ,
17
+ start_date = airflow .utils .dates .days_ago (1 ),
18
+ schedule_interval = None ,
19
+ catchup = False ,
20
+ )
21
+
22
+ create_traffic_table = PostgresOperator (
23
+ task_id = 'Create_table'
24
+ postgres_conn_id = "postgres_connect" ,
25
+ sql = "sql/create_table.sql" ,
26
+ )
27
+
28
+ load_traffic_table = PostgresOperator (
29
+ task_id = 'Load_table'
30
+ postgres_conn_id = "postgres_connect" ,
31
+ sql = "sql/create_table.sql" ,
32
+ )
33
+
34
+ create_traffic_table >> load_traffic_table
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments