Search code examples
pythonpython-3.xpython-2.7airflowkeyword-argument

AirFlowException - Python_Callable must be callable


I made a small change to an existing workflow, and it has broken airflow. Here is the code:

dag_name = platform + "_" + report['table']

dag = DAG(
    dag_name,
    catchup=True,
    default_args=default_args,
    schedule_interval=report['schedule']
)

with dag:

    trigger_report = PythonOperator(
        task_id=dag.dag_id + '_trigger_report',
        python_callable=trigger_report,
        provide_context=True,
        op_kwargs={
            'report_name': report['report'],
            'amazonmws_conn_id': default_args['amazonmws_conn_id']
        },
        dag=dag
    )

Here is the error I'm receiving:

airflow.exceptions.AirflowException: python_callable param must be callable


Solution

  • seems like you are passing trigger_report itself as the python_callable.

    Is this intentional? does it already have a value?
    (probably, otherwise you would've gotten a NameError: name 'trigger_report' is not defined)