tanaydalmia commented on issue #50202:
URL: https://github.com/apache/airflow/issues/50202#issuecomment-2857942952

   @dylanbstorey For the above changes , got an unexpected keyword argument 
'context' error.
   If I add context or **kwargs as argument, then it will throw some jinja 
error.
   `(2025-05-07T09:51:23.111+0000] {abstractoperator.py:783} ERROR - Exception 
rendering Jinja template for task 'kafka_sensor_jira', field 'apply_function'. 
Template: <fun
   ction listen_function at 0x7f09ecc98b80>
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/abstractoperator.py",
 line 773, in _do_render_template_fields
       rendered_content = value(context=context, jinja_env=jinja_env)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   TypeError: listen_function() got an unexpected keyword argument 'context'
   [2025-05-07T09:51:23.114+0000] {taskinstance.py:3313} ERROR - Task failed 
with exception
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py",
 line 274, in _run_raw_task
       TaskInstance._execute_task_with_callbacks(
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py",
 line 3117, in _execute_task_with_callbacks
       task_orig = self.render_templates(context=context, jinja_env=jinja_env)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py",
 line 3540, in render_templates
       original_task.render_template_fields(context, jinja_env)
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/baseoperator.py",
 line 1442, in render_template_fields
       self._do_render_template_fields(self, self.template_fields, context, 
jinja_env, set())
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/abstractoperator.py",
 line 773, in _do_render_template_fields
       rendered_content = value(context=context, jinja_env=jinja_env)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   TypeError: listen_function() got an unexpected keyword argument 'context'`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to