Description
The Airflow contributor guidelines explicitly state that we should reduce the usage of the generic AirflowException in favor of more specific Python built-ins. I noticed a few places where AirflowException is currently being used improperly and should be replaced:
- In
airflow/models/connection.py, invalid connection strings raise AirflowException. These should be updated to ValueError.
- In
airflow/utils/helpers.py, string length limits and timeouts raise AirflowException. These should be updated to ValueError and TimeoutError.
I will be opening a PR for this shortly!
Use case/motivation
Improving codebase quality and adhering to the community's current coding standards by using specific exceptions (like ValueError and TimeoutError). This makes error handling and debugging clearer for users and contributors, rather than catching a broad AirflowException.
Related issues
None
Are you willing to submit a PR?
Code of Conduct
Description
The Airflow contributor guidelines explicitly state that we should reduce the usage of the generic
AirflowExceptionin favor of more specific Python built-ins. I noticed a few places whereAirflowExceptionis currently being used improperly and should be replaced:airflow/models/connection.py, invalid connection strings raiseAirflowException. These should be updated toValueError.airflow/utils/helpers.py, string length limits and timeouts raiseAirflowException. These should be updated toValueErrorandTimeoutError.I will be opening a PR for this shortly!
Use case/motivation
Improving codebase quality and adhering to the community's current coding standards by using specific exceptions (like
ValueErrorandTimeoutError). This makes error handling and debugging clearer for users and contributors, rather than catching a broadAirflowException.Related issues
None
Are you willing to submit a PR?
Code of Conduct