Taragolis commented on code in PR #25852: URL: https://github.com/apache/airflow/pull/25852#discussion_r951204676
########## airflow/providers/slack/utils/__init__.py: ########## @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from typing import Any, Dict, Optional + +from airflow.utils.module_loading import import_string + +try: + from airflow.utils.types import NOTSET +except ImportError: # TODO: Remove when the provider has an Airflow 2.3+ requirement. + + class ArgNotSet: + """Sentinel type for annotations, useful when None is not viable.""" + + NOTSET = ArgNotSet() # type: ignore[assignment] + + +def prefixed_extra_field(field: str, conn_type: str) -> str: + """Get prefixed extra field name.""" + return f"extra__{conn_type}__{field}" + + +class ConnectionExtraConfig: + """Helper class for rom Connection Extra. + + :param conn_type: Hook connection type. + :param conn_id: Connection ID uses for appropriate error messages. + :param extra: Connection extra dictionary. + """ Review Comment: I create separate class for use in further steps 1. Refactor `airflow.providers.slack.hooks.slack_webhook.SlackWebhookHook` which mostly designed for use with legacy [Slack Integrations](https://taragolisworkspace.slack.com/apps/A0F7XDUAZ-incoming-webhooks?tab=more_info) 2. Create new hook and connection which will use `slack_sdk.webhook.WebhookClient` and create integration with Slack Incoming Webhook based on [Slack API/App](https://api.slack.com/messaging/webhooks) -- 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]
