f
This commit is contained in:
7
.history/user1/testpostgre_20250905021614.py
Normal file
7
.history/user1/testpostgre_20250905021614.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from airflow.providers.postgres.operators.postgres import PostgresOperator
|
||||||
|
|
||||||
|
task = PostgresOperator(
|
||||||
|
task_id='test_query',
|
||||||
|
postgres_conn_id='my_postgres',
|
||||||
|
sql='SELECT 1;'
|
||||||
|
)
|
||||||
11
.history/user1/testpostgre_20250905023149.py
Normal file
11
.history/user1/testpostgre_20250905023149.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="hello_world",
|
||||||
|
start_date=datetime(2025, 1, 1),
|
||||||
|
schedule_interval="@daily",
|
||||||
|
catchup=False,
|
||||||
|
) as dag:
|
||||||
|
task = DummyOperator(task_id="dummy_task")
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
from airflow.providers.postgres.operators.postgres import PostgresOperator
|
from airflow import DAG
|
||||||
|
from airflow.operators.dummy import DummyOperator
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
task = PostgresOperator(
|
with DAG(
|
||||||
task_id='test_query',
|
dag_id="hello_world",
|
||||||
postgres_conn_id='my_postgres',
|
start_date=datetime(2025, 1, 1),
|
||||||
sql='SELECT 1;'
|
schedule_interval="@daily",
|
||||||
)
|
catchup=False,
|
||||||
|
) as dag:
|
||||||
|
task = DummyOperator(task_id="dummy_task")
|
||||||
|
|||||||
Reference in New Issue
Block a user