ferruzzi commented on code in PR #38693:
URL: https://github.com/apache/airflow/pull/38693#discussion_r1556195811


##########
airflow/providers/amazon/aws/hooks/bedrock.py:
##########
@@ -19,6 +19,37 @@
 from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
 
 
+class BedrockHook(AwsBaseHook):
+    """
+    Interact with Amazon Bedrock.
+
+    Provide thin wrapper around 
:external+boto3:py:class:`boto3.client("bedrock") <Bedrock.Client>`.
+
+    Additional arguments (such as ``aws_conn_id``) may be specified and
+    are passed down to the underlying AwsBaseHook.
+
+    .. seealso::
+        - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
+    """
+
+    client_type = "bedrock"
+
+    def __init__(self, *args, **kwargs) -> None:
+        kwargs["client_type"] = self.client_type
+        super().__init__(*args, **kwargs)
+
+    def _get_job_by_name(self, job_name: str):
+        return self.conn.get_model_customization_job(jobIdentifier=job_name)
+
+    def get_customize_model_job_state(self, job_name: str) -> str:
+        state = self._get_job_by_name(job_name)["status"]
+        self.log.info("Job '%s' state: %s", job_name, state)
+        return state
+
+    def get_job_arn(self, job_name: str) -> str:
+        return self._get_job_by_name(job_name)["jobArn"]

Review Comment:
   Yeah, they felt handy and made the Sensor unit tests a little easier to 
mock, but I'll drop them.



-- 
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]

Reply via email to