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
{{ message }}
Repository navigation
Invalid keys in executor_config should raise an error #47702
The executor_config dictionary used to configure worker pods with the Kubernetes executor does not raise an error if any keys besides "pod_override" or "pod_template_file" are used. Even with invalid keys, the DAG is imported and will run as expected. The invalid executor_config will simply be disregarded.
What you think should happen instead
If any keys besides "pod_override" or "pod_template_file" are used in executor_config, and error (maybe a DAG import error) should be raised.
This should give the user feedback that their executor_config keys are invalid and need to be removed or changed.
How to reproduce
Create an Airflow instance that uses the Kubernetes Executor.
Create a DAG with the following code including an invalid key in executor_config.
import datetime
from airflow.decorators import dag
from airflow.decorators import task
executor_config = {
"key": "value"
}
@dag(start_date=datetime.datetime(2024, 10, 1), schedule="@daily", catchup=False)
def dag_1():
@task(executor_config=executor_config)
def task_1():
print("task 1")
task_1()
dag_1()
Observe that the DAG will be imported and run on the Airflow instance without any issues.
I think we should instead introduce a stricter type to the executor_config and not just let it be a dict which can have any values flowing in?
With multiple / hybrid executors it may be tricky to detect on the Operator initialization stage which executor would be used and properly validate the config.
Maybe executors can have some subclass of the common config connected, so at least we can demand it to be of the specific type, and the user can "prevalidate" their config this way. When hybrid executors are gone, this task would be more easy. Because with the deterministic executor from the operator args it should be simple to map it with the proper executor config type and "validate"
Hi @karenbraganz, this issue is highly relevant to our work, as we frequently use executor_config settings, so i think this would be great if we can detect any invalid keys when the DAG is imported.
For the reasons @insomnes stated, we can't do any broad validation at the base class level at this point in time. Groundwork (similar to what @insomnes described) would have to be done first, such as each executor creating a type for their executor_config and validation functions that the Base Operator/Dag processor code could use to validate the input in a transparent way. But that is a large chunk of work that needs to be done delicately in it's own project of sorts.
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
Activity
amoghrajesh commentedon Mar 13, 2025
I think we should instead introduce a stricter type to the executor_config and not just let it be a dict which can have any values flowing in?
insomnes commentedon Mar 13, 2025
With multiple / hybrid executors it may be tricky to detect on the Operator initialization stage which executor would be used and properly validate the config.
Maybe executors can have some subclass of the common config connected, so at least we can demand it to be of the specific type, and the user can "prevalidate" their config this way. When hybrid executors are gone, this task would be more easy. Because with the deterministic executor from the operator args it should be simple to map it with the proper executor config type and "validate"
HsiuChuanHsu commentedon Jul 17, 2025
Hi @karenbraganz, this issue is highly relevant to our work, as we frequently use executor_config settings, so i think this would be great if we can detect any invalid keys when the DAG is imported.
o-nikolas commentedon Jul 18, 2025
@karenbraganz
For the reasons @insomnes stated, we can't do any broad validation at the base class level at this point in time. Groundwork (similar to what @insomnes described) would have to be done first, such as each executor creating a type for their executor_config and validation functions that the Base Operator/Dag processor code could use to validate the input in a transparent way. But that is a large chunk of work that needs to be done delicately in it's own project of sorts.
github-actions commentedon Jul 19, 2026
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
github-actions commentedon Aug 19, 2026
This issue has been closed because it has not received response from the issue author.