You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing the False value to a decorated dag function I get this traceback below. Also the default value is not shown when clicking 'trigger dag w/ config'.
[2022-04-07, 20:08:57 UTC] {standard_task_runner.py:52} INFO - Started process 2170 to run task
[2022-04-07, 20:08:57 UTC] {standard_task_runner.py:76} INFO - Running: ['airflow', 'tasks', 'run', 'check_ui_config', 'value_consumer', 'manual__2022-04-07T20:08:56.914410+00:00', '--job-id', '24', '--raw', '--subdir', 'DAGS_FOLDER/check_ui_config.py', '--cfg-path', '/tmp/tmpww9euksv', '--error-file', '/tmp/tmp7kjdfks5']
[2022-04-07, 20:08:57 UTC] {standard_task_runner.py:77} INFO - Job 24: Subtask value_consumer
[2022-04-07, 20:08:57 UTC] {logging_mixin.py:109} INFO - Running <TaskInstance: check_ui_config.value_consumer manual__2022-04-07T20:08:56.914410+00:00 [running]> on host a643f8828615
[2022-04-07, 20:08:57 UTC] {taskinstance.py:1700} ERROR - Task failed with exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1329, in _run_raw_task
self._execute_task_with_callbacks(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1418, in _execute_task_with_callbacks
self.render_templates(context=context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1992, in render_templates
self.task.render_template_fields(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1061, in render_template_fields
self._do_render_template_fields(self, self.template_fields, context, jinja_env, set())
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1074, in _do_render_template_fields
rendered_content = self.render_template(content, context, jinja_env, seen_oids)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1125, in render_template
return tuple(self.render_template(element, context, jinja_env) for element in content)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1125, in <genexpr>
return tuple(self.render_template(element, context, jinja_env) for element in content)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1116, in render_template
return content.resolve(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/param.py", line 226, in resolve
raise AirflowException(f'No value could be resolved for parameter {self._name}')
airflow.exceptions.AirflowException: No value could be resolved for parameter test
[2022-04-07, 20:08:57 UTC] {taskinstance.py:1267} INFO - Marking task as FAILED. dag_id=check_ui_config, task_id=value_consumer, execution_date=20220407T200856, start_date=20220407T200857, end_date=20220407T200857
[2022-04-07, 20:08:57 UTC] {standard_task_runner.py:89} ERROR - Failed to execute job 24 for task value_consumer
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/airflow/task/task_runner/standard_task_runner.py", line 85, in _start_by_fork
args.func(args, dag=self.dag)
File "/usr/local/lib/python3.9/site-packages/airflow/cli/cli_parser.py", line 48, in command
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/airflow/utils/cli.py", line 92, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/airflow/cli/commands/task_command.py", line 298, in task_run
_run_task_by_selected_method(args, dag, ti)
File "/usr/local/lib/python3.9/site-packages/airflow/cli/commands/task_command.py", line 107, in _run_task_by_selected_method
_run_raw_task(args, ti)
File "/usr/local/lib/python3.9/site-packages/airflow/cli/commands/task_command.py", line 180, in _run_raw_task
ti._run_raw_task(
File "/usr/local/lib/python3.9/site-packages/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1329, in _run_raw_task
self._execute_task_with_callbacks(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1418, in _execute_task_with_callbacks
self.render_templates(context=context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 1992, in render_templates
self.task.render_template_fields(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1061, in render_template_fields
self._do_render_template_fields(self, self.template_fields, context, jinja_env, set())
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1074, in _do_render_template_fields
rendered_content = self.render_template(content, context, jinja_env, seen_oids)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1125, in render_template
return tuple(self.render_template(element, context, jinja_env) for element in content)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1125, in <genexpr>
return tuple(self.render_template(element, context, jinja_env) for element in content)
File "/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py", line 1116, in render_template
return content.resolve(context)
File "/usr/local/lib/python3.9/site-packages/airflow/models/param.py", line 226, in resolve
raise AirflowException(f'No value could be resolved for parameter {self._name}')
airflow.exceptions.AirflowException: No value could be resolved for parameter test
What you think should happen instead
I think airflow should be able to handle the False value when passing it as a dag param.
This appears to be the case for any falsey value. Consider this dag:
@dagdefparamstuff(x, a=Param(2, minimum=0)):
@taskdefadd(one, other):
print(one+other)
add(x, a)
the_dag=paramstuff(3) # two params: x,a# add says 5 unless you specify different params at run time# the_dag = paramstuff(0) # one dag param: a# add says: AirflowException: No value could be resolved for parameter x
I'm not sure how we should treat positional args being passed into @dag decorated functions (I'm tempted to say that they shouldn't interact with DagParams at all, leave that to the kwargs). But whatever we do, it probably shouldn't depend on whether those values are falsey.
Apache Airflow version
2.2.3
What happened
When passing the
False
value to a decorated dag function I get this traceback below. Also the default value is not shown when clicking 'trigger dag w/ config'.What you think should happen instead
I think airflow should be able to handle the False value when passing it as a dag param.
How to reproduce
Operating System
Docker (debian:buster)
Versions of Apache Airflow Providers
No response
Deployment
Astronomer
Deployment details
Astro cli with this image:
quay.io/astronomer/ap-airflow-dev:2.2.3-2
Anything else
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: