Добавить test_clickhouse_dag.py
This commit is contained in:
16
test_clickhouse_dag.py
Normal file
16
test_clickhouse_dag.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
from airflow import DAG
|
||||||
|
from airflow.providers.clickhouse.hooks.clickhouse import ClickHouseHook
|
||||||
|
from airflow.operators.python import PythonOperator
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
def test_conn():
|
||||||
|
hook = ClickHouseHook(clickhouse_conn_id="my_clickhouse_provider")
|
||||||
|
hook.run("SELECT 1")
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
dag_id="test_clickhouse_dag",
|
||||||
|
start_date=datetime(2024, 1, 1),
|
||||||
|
schedule=None,
|
||||||
|
catchup=False,
|
||||||
|
) as dag:
|
||||||
|
PythonOperator(task_id="check_clickhouse", python_callable=test_conn)
|
||||||
Reference in New Issue
Block a user