You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/19 08:05:27 UTC

[GitHub] [airflow] AlexisBRENON commented on issue #14880: SlackAPIFileOperator is broken

AlexisBRENON commented on issue #14880:
URL: https://github.com/apache/airflow/issues/14880#issuecomment-802634881


   From what I understand of the API documentation (I don't use many API), the `file.upload` method does not support the "JSON POST" arguments, while `chat.postMessage` does. https://api.slack.com/web#methods_supporting_json
   However, the base `SlackAPIOperator` does not let the subclasses choose the way to send arguments as the `execute` method ends with:
   ```
           slack.call(self.method, json=self.api_params)
   ```
   Always passing the arguments as JSON payload.
   
   Maybe we should let the subclasses choose how to pass their arguments with something like:
   ```
   slack.call(self.method, data=self.form_data, params=self.params, json=self.json_data)
   ```
   
   We can keep some kind of retro-compatibility by providing a default implementation for the `json_data` which returns the current `api_params` fields (while still deprecating it).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org