From 225fe3134fca78acd33dbd5f11c1609585bb5758 Mon Sep 17 00:00:00 2001 From: Atalya Alon <20992625+atalyaalon@users.noreply.github.com> Date: Wed, 26 Apr 2023 21:21:10 +0300 Subject: [PATCH] Add kwargs (#38) * add kwarg * add kwarg --- airflow_server/dags/cbs_import_from_s3.py | 3 +-- airflow_server/dags/infographics.py | 3 +-- airflow_server/dags/infographics_generate_image.py | 3 +-- airflow_server/dags/infographics_road_segments.py | 3 +-- airflow_server/dags/news_flash.py | 4 ++-- airflow_server/dags/test_logs.py | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/airflow_server/dags/cbs_import_from_s3.py b/airflow_server/dags/cbs_import_from_s3.py index 3ba3bf8..d548649 100644 --- a/airflow_server/dags/cbs_import_from_s3.py +++ b/airflow_server/dags/cbs_import_from_s3.py @@ -15,8 +15,7 @@ with DAG('cbs-import-from-s3', **dag_kwargs) as cbs_import_from_s3: - CliBashOperator( - cmd='anyway-etl anyway-kubectl-exec python3 main.py process cbs --source s3' + CliBashOperator(cmd='anyway-etl anyway-kubectl-exec python3 main.py process cbs --source s3' '{% if dag_run.conf.get("load_start_year") %} --load_start_year {{ dag_run.conf["load_start_year"] }}{% endif %}', task_id='cbs-import-from-s3' ) \ No newline at end of file diff --git a/airflow_server/dags/infographics.py b/airflow_server/dags/infographics.py index 13cd53d..fa08878 100644 --- a/airflow_server/dags/infographics.py +++ b/airflow_server/dags/infographics.py @@ -15,7 +15,6 @@ with DAG('fill-infographics-cache', **dag_kwargs) as fill_infographics_cache_dag: - CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 main.py process infographics-data-cache --update', + CliBashOperator(cmd='anyway-etl anyway-kubectl-exec python3 main.py process infographics-data-cache --update', task_id='fill-infographics-cache' ) diff --git a/airflow_server/dags/infographics_generate_image.py b/airflow_server/dags/infographics_generate_image.py index b0aaf04..73635fa 100644 --- a/airflow_server/dags/infographics_generate_image.py +++ b/airflow_server/dags/infographics_generate_image.py @@ -14,8 +14,7 @@ with DAG('generate-infographics-images', **dag_kwargs, params={ "newsflash_id": Param(0, type="integer"), },) as fill_infographics_cache_dag: - CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 \ + CliBashOperator(cmd='anyway-etl anyway-kubectl-exec python3 \ main.py generate infographics_pictures --id {dag_kwargs[params][newsflash_id]}', task_id='generate-infographics-images', ) diff --git a/airflow_server/dags/infographics_road_segments.py b/airflow_server/dags/infographics_road_segments.py index 681d9ca..17e4ccf 100644 --- a/airflow_server/dags/infographics_road_segments.py +++ b/airflow_server/dags/infographics_road_segments.py @@ -15,7 +15,6 @@ with DAG('fill-infographics-cache-for-road-segments', **dag_kwargs) as fill_infographics_cache_dag_for_road_segments: - CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 main.py process infographics-data-cache-for-road-segments', + CliBashOperator(cmd='anyway-etl anyway-kubectl-exec python3 main.py process infographics-data-cache-for-road-segments', task_id='fill-infographics-cache-for-road-segments' ) diff --git a/airflow_server/dags/news_flash.py b/airflow_server/dags/news_flash.py index 34a3210..8409cce 100644 --- a/airflow_server/dags/news_flash.py +++ b/airflow_server/dags/news_flash.py @@ -17,7 +17,7 @@ with DAG('process-news-flash', **dag_kwargs, schedule_interval='*/5 * * * *') as process_news_flash_dag: CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 main.py process news-flash', + cmd='anyway-etl anyway-kubectl-exec python3 main.py process news-flash', task_id='process-news-flash' ) @@ -26,7 +26,7 @@ description='Update a single news flash item based on id, must run manually with json, example:' '{"news_flash_id": "65516"}') as update_news_flash_dag: CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 main.py ' + cmd='anyway-etl anyway-kubectl-exec python3 main.py ' 'update-news-flash update --news_flash_id {{ dag_run.conf["news_flash_id"] }}', task_id='update-news-flash' ) diff --git a/airflow_server/dags/test_logs.py b/airflow_server/dags/test_logs.py index b1636fa..501b287 100644 --- a/airflow_server/dags/test_logs.py +++ b/airflow_server/dags/test_logs.py @@ -16,6 +16,6 @@ with DAG('test-logs', **dag_kwargs) as test_logs: CliBashOperator( - 'anyway-etl anyway-kubectl-exec python3 main.py scripts test-airflow', + cmd='anyway-etl anyway-kubectl-exec python3 main.py scripts test-airflow', task_id='test_logs' )