17 lines
426 B
Python
17 lines
426 B
Python
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;",
|
|
)
|