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

   `TelegramFileOperator.execute` calls 
`TelegramHook.send_file(**self.telegram_kwargs)`, but `send_file` takes a 
single `api_params` dict, the same as `send_message`. So every run fails before 
anything is sent:
   
       TypeError: TelegramHook.send_file() got an unexpected keyword argument 
'file'
   
   This passes the dict through as-is, the same way `TelegramOperator` does for 
`send_message`.
   
   The operator's `execute` path had no test, which is probably why this went 
unnoticed. The call and the `send_file` signature are the same in the published 
4.7.0 (where the operator was added), 4.8.0 and 4.10.1 packages.
   
   Added a regression test for `TelegramFileOperator.execute` (file only, and 
file plus extra `telegram_kwargs`). It fails without the fix and passes with it.
   
   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]

  • [PR] Fix TelegramFileOperator ... Donniedarko45 (via GitHub) via commits

Reply via email to