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


##########
providers/amazon/src/airflow/providers/amazon/aws/triggers/sagemaker_unified_studio_notebook.py:
##########
@@ -0,0 +1,150 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Trigger for monitoring SageMaker Unified Studio Notebook runs 
asynchronously."""
+
+from __future__ import annotations
+
+import asyncio
+from collections.abc import AsyncIterator
+from functools import partial
+from typing import Any
+
+import boto3
+
+from airflow.triggers.base import BaseTrigger, TriggerEvent
+
+IN_PROGRESS_STATES = {"QUEUED", "STARTING", "RUNNING", "STOPPING"}
+FINISHED_STATES = {"SUCCEEDED", "STOPPED"}
+FAILURE_STATES = {"FAILED"}
+
+TWELVE_HOURS_IN_MINUTES = 12 * 60
+
+
+class SageMakerUnifiedStudioNotebookTrigger(BaseTrigger):

Review Comment:
   I'm not sure how well a waiter would play with an async call like this, but 
if it wasn't async I'd say 100% this is a perfect case for a custom waiter.  So 
it's a solid maybe?  Unless @qaziashikin tried it and knows they won't work 
with their async situation, I'd definitely suggest trying it.
   
   
https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/waiters/README.md



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