I'm trying to pass a custom arg to a python operator, but when trying to
resolve  *kwargs.get('log_type')*, I get 'None'.

Anyone have any issues with this before?

*LOG_TYPES = ['abc_log', 'xyz_log']*

def raw_log_callable(ds, **kwargs):
    exec_date = str(kwargs.get('task_instance').execution_date.date() -
timedelta(days=1)).split()[0]
    task_logic.main({'<date>' : exec_date, '<log_type>' :
*kwargs.get('log_type')*})


for log_type in LOG_TYPES:
    raw_log_py_operator = PythonOperator(
        task_id='{}-logs-copy-to-s3'.format(log_type),
        provide_context=True,
        python_callable=raw_log_callable,
        dag=raw_log_dag,
*        log_type=log_type*
    )

Reply via email to