Skip to content

Commit

Permalink
Add kwargs (#38)
Browse files Browse the repository at this point in the history
* add kwarg

* add kwarg
  • Loading branch information
atalyaalon authored Apr 26, 2023
1 parent 9101ce6 commit 225fe31
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions airflow_server/dags/cbs_import_from_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
3 changes: 1 addition & 2 deletions airflow_server/dags/infographics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
3 changes: 1 addition & 2 deletions airflow_server/dags/infographics_generate_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)
3 changes: 1 addition & 2 deletions airflow_server/dags/infographics_road_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
4 changes: 2 additions & 2 deletions airflow_server/dags/news_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

Expand All @@ -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'
)
Expand Down
2 changes: 1 addition & 1 deletion airflow_server/dags/test_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)

0 comments on commit 225fe31

Please sign in to comment.