Добавить my_con_test_postgre.py
This commit is contained in:
16
my_con_test_postgre.py
Normal file
16
my_con_test_postgre.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
from airflow import DAG
|
||||||
|
from airflow.providers.postgres.operators.postgres import PostgresOperator
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="test_postgres_connection",
|
||||||
|
start_date=datetime(2023, 1, 1),
|
||||||
|
schedule_interval=None,
|
||||||
|
catchup=False,
|
||||||
|
) as dag:
|
||||||
|
|
||||||
|
test_connection = PostgresOperator(
|
||||||
|
task_id="test_postgres",
|
||||||
|
postgres_conn_id="my_con_test_postgre",
|
||||||
|
sql="SELECT 1;",
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user