uranusjr commented on code in PR #27823:
URL: https://github.com/apache/airflow/pull/27823#discussion_r1028678124
##########
airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -405,9 +411,68 @@ def __init__(
self.resource_type = resource_type
self._region_name = region_name
- self._config = config
+ self._config = config or botocore.config.Config()
self._verify = verify
+ @classmethod
+ def _get_provider_version(cls) -> str:
+ """Checks the Providers Manager for the package version."""
+ manager = ProvidersManager()
+ provider_name = manager.hooks[cls.conn_type].package_name # type:
ignore[union-attr]
Review Comment:
Simply checking `if not hook` (or `if hook is None`) makes sense and looks
simple enough to me.
##########
airflow/providers/amazon/aws/hooks/base_aws.py:
##########
@@ -405,9 +411,68 @@ def __init__(
self.resource_type = resource_type
self._region_name = region_name
- self._config = config
+ self._config = config or botocore.config.Config()
self._verify = verify
+ @classmethod
+ def _get_provider_version(cls) -> str:
+ """Checks the Providers Manager for the package version."""
+ manager = ProvidersManager()
+ provider_name = manager.hooks[cls.conn_type].package_name # type:
ignore[union-attr]
Review Comment:
Checking `if not hook` (or `if hook is None`) makes sense and looks simple
enough to me.
--
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]