Donniedarko45 opened a new pull request, #76914:
URL: https://github.com/apache/airflow/pull/76914

   The Telegram hook and operators raise the generic `AirflowException` for 
missing arguments: no token, no connection id, no `chat_id`, no `text` or no 
`file`. These are plain caller-argument errors, so this switches all 8 of them 
to `ValueError`, as the contributing docs ask ("Don't raise AirflowException 
directly"). The messages are unchanged.
   
   One thing to be aware of: code that wraps these calls in `except 
AirflowException` will no longer catch them.
   
   With this the Telegram provider has no `raise AirflowException` left, so 
both of its entries are removed from `generated/known_airflow_exceptions.txt`.
   
   Tests: the existing tests now expect `ValueError`, and there are new tests 
for the two cases that had none (a hook created with neither a token nor a 
connection id, and `TelegramFileOperator` with `telegram_conn_id=None`). The 
Telegram provider unit tests pass. Pre-commit checks pass except 
`check-template-fields-valid`, which needs breeze and Docker and was not run 
locally (same for provider mypy).


-- 
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