From 5a28e445821374c4229fea98a64dcc3fc291e52c Mon Sep 17 00:00:00 2001 From: airflow Date: Wed, 24 Sep 2025 07:08:55 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20test=5Fclickhouse=5Fdag.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_clickhouse_dag.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test_clickhouse_dag.py b/test_clickhouse_dag.py index 7e5ba8a..b814a90 100644 --- a/test_clickhouse_dag.py +++ b/test_clickhouse_dag.py @@ -3,20 +3,15 @@ from airflow.operators.python import PythonOperator from airflow_clickhouse_plugin.hooks.clickhouse import ClickHouseHook from datetime import datetime -def test_clickhouse(): +def test_conn(): hook = ClickHouseHook(clickhouse_conn_id="my_clickhouse_provider") - # Простейший запрос - result = hook.get_records("SELECT 1") - print("ClickHouse result:", result) + result = hook.get_conn().execute("SELECT 1") + print(result) with DAG( dag_id="test_clickhouse_dag", start_date=datetime(2024, 1, 1), schedule=None, catchup=False, - tags=["example"], ) as dag: - test_task = PythonOperator( - task_id="check_clickhouse", - python_callable=test_clickhouse - ) + PythonOperator(task_id="check_clickhouse", python_callable=test_conn)