o-nikolas commented on code in PR #76646:
URL: https://github.com/apache/airflow/pull/76646#discussion_r4531099549
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/bedrock.py:
##########
Review Comment:
Small one: still says the DRAFT version "is immediately usable", and this PR
shows that isn't quite true. Maybe change it to say the DRAFT is usable once it
reaches READY, which the operator now waits for by default?
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/bedrock.py:
##########
@@ -1547,8 +1574,18 @@ def execute(self, context: Context) -> str:
}
)
response = self.hook.conn.create_guardrail_version(**kwargs)
+ guardrail_id = response["guardrailId"]
version = response["version"]
- self.log.info("Guardrail %s version %s created.",
response["guardrailId"], version)
+ self.log.info("Guardrail %s version %s created.", guardrail_id,
version)
+
+ if self.wait_for_completion:
+ self.log.info("Waiting for guardrail %s to be ready.",
guardrail_id)
+ self.hook.get_waiter("guardrail_ready").wait(
+ guardrailIdentifier=guardrail_id,
+ guardrailVersion="DRAFT",
+ WaiterConfig={"Delay": self.waiter_delay, "MaxAttempts":
self.waiter_max_attempts},
Review Comment:
After `CreateGuardrailVersion`, is it the DRAFT that goes into `VERSIONING`,
or the new numbered version? The API docs don't say. If it's the numbered
version, this wait on DRAFT returns straight away and the version-then-delete
flake could still happen, and waiting on `guardrailVersion=version` would cover
it. If you saw DRAFT in `VERSIONING` during your runs, that answers it.
--
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]