vincbeck commented on code in PR #72521:
URL: https://github.com/apache/airflow/pull/72521#discussion_r3968790019


##########
providers/amazon/tests/system/amazon/aws/utils/bedrock.py:
##########
@@ -37,11 +42,27 @@ def get_text_inference_profile_arn() -> str:
     from airflow.providers.amazon.aws.hooks.bedrock import BedrockHook
 
     client = BedrockHook().conn
+
+    # Bedrock rejects a model its provider marked as legacy, so a legacy model 
can not be relied on here.
+    # The inference profile summaries do not carry the lifecycle status, only 
the foundation models a
+    # profile resolves to do.
+    legacy_model_ids = {
+        model["modelId"]
+        for model in client.list_foundation_models()["modelSummaries"]
+        if model.get("modelLifecycle", {}).get("status") == "LEGACY"
+    }
+    log.info("Legacy model IDs: %s", sorted(legacy_model_ids))
+
     profiles = 
client.list_inference_profiles(typeEquals="SYSTEM_DEFINED")["inferenceProfileSummaries"]
     arns = [

Review Comment:
   Sure



##########
providers/amazon/tests/system/amazon/aws/utils/bedrock.py:
##########
@@ -37,11 +42,27 @@ def get_text_inference_profile_arn() -> str:
     from airflow.providers.amazon.aws.hooks.bedrock import BedrockHook
 
     client = BedrockHook().conn
+
+    # Bedrock rejects a model its provider marked as legacy, so a legacy model 
can not be relied on here.
+    # The inference profile summaries do not carry the lifecycle status, only 
the foundation models a
+    # profile resolves to do.
+    legacy_model_ids = {
+        model["modelId"]
+        for model in client.list_foundation_models()["modelSummaries"]
+        if model.get("modelLifecycle", {}).get("status") == "LEGACY"

Review Comment:
   Makes sense



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