Skip to content

Commit

Permalink
update env_vars early on
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Dec 13, 2024
1 parent ab8be7a commit 06884ed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dags/stellar_etl_airflow/build_internal_export_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,19 @@ def build_export_task(
]
etl_cmd_string = " ".join(cmd_args)
arguments = f""" {command} {etl_cmd_string} 1>> stdout.out 2>> stderr.out && cat stdout.out && cat stderr.out && echo "{{\\"output\\": \\"{output_filepath}\\"}}" >> /airflow/xcom/return.json"""
env_vars.update(
{
"EXECUTION_DATE": "{{ ds }}",
"AIRFLOW_START_TIMESTAMP": "{{ ti.start_date.strftime('%Y-%m-%dT%H:%M:%SZ') }}",
}
)

return KubernetesPodOperator(
task_id=task_name,
name=task_name,
namespace=Variable.get("k8s_namespace"),
service_account_name=Variable.get("k8s_service_account"),
env_vars=env_vars.update(
{
"EXECUTION_DATE": "{{ ds }}",
"AIRFLOW_START_TIMESTAMP": "{{ ti.start_date.strftime('%Y-%m-%dT%H:%M:%SZ') }}",
}
),
env_vars=env_vars,
image=image,
cmds=["bash", "-c"],
arguments=[arguments],
Expand Down

0 comments on commit 06884ed

Please sign in to comment.