uranusjr commented on code in PR #33780: URL: https://github.com/apache/airflow/pull/33780#discussion_r1307004230
########## airflow/providers/amazon/aws/hooks/ecr.py: ########## @@ -20,11 +20,14 @@ import base64 import logging from dataclasses import dataclass -from datetime import datetime +from typing import TYPE_CHECKING from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook from airflow.utils.log.secrets_masker import mask_secret +if TYPE_CHECKING: + from datetime import datetime Review Comment: The above only fails because you didn’t provide `from __future__ import annotations`. With the future import, stripping all imports strictly only used for annotation is completely safe at runtime. ########## airflow/providers/amazon/aws/hooks/ecr.py: ########## @@ -20,11 +20,14 @@ import base64 import logging from dataclasses import dataclass -from datetime import datetime +from typing import TYPE_CHECKING from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook from airflow.utils.log.secrets_masker import mask_secret +if TYPE_CHECKING: + from datetime import datetime Review Comment: The above only fails because you didn’t provide `from __future__ import annotations`. With the future import, stripping all imports strictly only used for annotation is completely safe at 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]
