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


##########
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:
   Since the pick among non-legacy candidates still follows 
list_inference_profiles order, the model under test can change between runs. 
Would it make sense to add a deterministic tiebreak, e.g. sort the candidates 
and pick the oldest non-legacy Sonnet, so runs are reproducible and we don't 
land on a brand-new release before batch inference or RAG support it?



##########
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:
   Should we filter for just `ACTIVE` so that if there's a new state like 
`DEPRECATED` or something else, this would still keep working?



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