I have the below dag which is triggered via cli with a conf parameter for job_id. I have successfully triggered the dag, and can retrieve the job_id but im not sure how to now pass this parameter to the batchoperator?
dag = DAG(
dag_id='example_batch_submit_job',
schedule_interval=None,
start_date=datetime(2022, 7, 14),
tags=['batch_job'],
catchup=False)
def get_inputs_config(**kwargs):
parameters = ("{}".format(kwargs['dag_run'].conf['job_id'])
print("Remotely received value of {} for key=job_id".format(parameters))
return parameters
run_this = PythonOperator(
task_id='get_input',
provide_context=True,
python_callable=get_inputs_config,
dag=DAG,
)
submit_batch_job = BatchOperator(
task_id='submit_batch_job_etl',
job_name=JOB_NAME,
job_queue=JOB_QUEUE,
job_definition=JOB_DEFINITION,
parameters={} <-------- here
)