Copilot commented on code in PR #62842:
URL: https://github.com/apache/airflow/pull/62842#discussion_r2882589158


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/triggers/powerbi.py:
##########
@@ -152,8 +152,23 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
                 request_body=self.request_body,
             )
 
-            if dataset_refresh_id:
-                self.log.info("Triggered dataset refresh %s", 
dataset_refresh_id)
+            if not dataset_refresh_id:
+                yield TriggerEvent(
+                    {
+                        "status": "error",
+                        "dataset_refresh_status": None,
+                        "message": "Failed to trigger the dataset refresh.",
+                        "dataset_refresh_id": None,
+                    }
+                )
+                return
+
+            self.log.info("Triggered dataset refresh %s", dataset_refresh_id)
+            # Set the dataset_refresh_id for polling
+            self.dataset_refresh_id = dataset_refresh_id
+
+            # If wait_for_termination is False, return immediately after 
triggering
+            if not self.wait_for_termination:

Review Comment:
   The class docstring currently says "Wait for termination will always be 
True.", but the trigger now explicitly supports `wait_for_termination=False` 
(and returns success immediately in that case). Please update the 
docstring/param description to match the actual behavior so users and future 
maintainers aren’t misled.



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