Taragolis commented on code in PR #26374:
URL: https://github.com/apache/airflow/pull/26374#discussion_r1015388601
##########
airflow/providers/slack/transfers/sql_to_slack.py:
##########
@@ -165,3 +193,115 @@ def execute(self, context: Context) -> None:
self._render_and_send_slack_message(context, df)
self.log.debug('Finished sending SQL data to Slack')
+
+
+class SqlToSlackApiFileOperator(BaseSqlToSlackOperator):
Review Comment:
Initially when I started refactor slack provider I've also want to create
additional hook but after deeply investigate I've found that Legacy and based
on slack API Incoming Webhook has almost the same interface.
Legacy supports additional features which is not available in new one:
change icons, username and channels.
And it is impossible (just my personal findings) to determine witch Webhook
URL use for Legacy Incoming Webhook and which one for new one - even HTTP
responses almost the same. That is why I combine usage in
`airflow.providers.slack.hooks.slack_webhook.SlackWebhookHook` with warnings
about parameters which supported by Legacy only
If we want to just **send message as a text** than we might create some of
generic interface because all three methods support
[blocks](https://api.slack.com/block-kit) and fallback messages.
With send as file (upload) it is quite difficult because it is different
method of API with different parameters and it only supported by Slack API not
Webhook. And in case of send as file we do not need overwrite
`render_template_fields` for add Jinja filter in runtime
--
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]