KoviAnusha commented on code in PR #56911: URL: https://github.com/apache/airflow/pull/56911#discussion_r2446899106
########## providers/discord/src/airflow/providers/discord/hooks/discord_webhook.py: ########## @@ -19,10 +19,70 @@ import json import re -from typing import Any +from typing import TYPE_CHECKING, Any + +import aiohttp +from asgiref.sync import sync_to_async from airflow.exceptions import AirflowException -from airflow.providers.http.hooks.http import HttpHook +from airflow.providers.http.hooks.http import HttpAsyncHook, HttpHook + +if TYPE_CHECKING: + from airflow.providers.discord.version_compat import Connection + + +class DiscordCommonHandler: + """Contains the common functionality.""" + + def get_webhook_endpoint(self, conn: Connection, webhook_endpoint: str | None) -> str: + """ Review Comment: The Connection import should come from airflow.models.connection, not version_compat, since that module doesn’t define it. Also, you can make conn type optional (Connection | None) and fix type hints for http_conn_id as str | None to satisfy 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]
