gopidesupavan commented on code in PR #55308: URL: https://github.com/apache/airflow/pull/55308#discussion_r2333580576
########## providers/smtp/tests/unit/smtp/hooks/test_smtp.py: ########## @@ -22,17 +22,49 @@ import smtplib import tempfile from email.mime.application import MIMEApplication -from unittest.mock import Mock, call, patch +from unittest import mock +from unittest.mock import AsyncMock, Mock, call, patch +import aiosmtplib import pytest from airflow.exceptions import AirflowException -from airflow.models import Connection from airflow.providers.smtp.hooks.smtp import SmtpHook, build_xoauth2_string +from tests_common.test_utils.version_compat import AIRFLOW_V_3_1_PLUS + +try: + from airflow.sdk import Connection Review Comment: @ferruzzi here is the issue, the import would work for 3.0.6 because this module exists. but the as_json method was added recently to the task_sdk, that is not in 3.0.6 so thats the reason it failed. https://github.com/apache/airflow/pull/53870 you can import conditionally for now this `from airflow.sdk import Connection` only for after task-sdk > 3.0.6 when next release cuts we no need this condition as the compat tests will get update 3.0.7 release. -- 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]
