From 935ca3109183ac46e875306f2f67150c163128a7 Mon Sep 17 00:00:00 2001 From: airflow Date: Thu, 18 Sep 2025 16:53:59 +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=20clickhouse=5Fdag.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clickhouse_dag.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clickhouse_dag.py b/clickhouse_dag.py index 3c813c9..2c9229d 100644 --- a/clickhouse_dag.py +++ b/clickhouse_dag.py @@ -1,7 +1,6 @@ from airflow import DAG from airflow.providers.http.operators.http import SimpleHttpOperator from datetime import datetime -from urllib.parse import urlencode with DAG( dag_id="clickhouse_list_tables", @@ -12,10 +11,10 @@ with DAG( list_tables = SimpleHttpOperator( task_id="list_tables", - http_conn_id="clickhouse_http", # Connection в Airflow - endpoint="/", # ClickHouse HTTP + http_conn_id="clickhouse_http", + endpoint="/", method="POST", - data=urlencode({"query": "SHOW TABLES"}), # Нужно как x-www-form-urlencoded - headers={"Content-Type": "application/x-www-form-urlencoded"}, - log_response=True, # покажет результат в логах Airflow + data="SHOW TABLES", + headers={"Content-Type": "text/plain"}, + log_response=True, )