dabla commented on code in PR #63829:
URL: https://github.com/apache/airflow/pull/63829#discussion_r2977083931


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/powerbi.py:
##########
@@ -189,6 +190,22 @@ async def get_refresh_details_by_refresh_id(
 
         return refresh_details
 
+    def trigger_dataset_refresh_sync(
+        self, *, dataset_id: str, group_id: str, request_body: dict[str, Any] 
| None = None
+    ) -> str:
+        """
+        Trigger Power BI Dataset refresh synchronously.
+
+        This is a wrapper around the async `trigger_dataset_refresh` method.
+        """
+        return asyncio.run(

Review Comment:
   > > I think a more advance solution with triggers would be more suitable, 
which would mean with multiple next_methods.
   > 
   > Thanks for the suggestion. I refactored this into a two-step deferrable 
flow with multiple callbacks.
   > 
   > * `execute()` now always defers to `PowerBITrigger` with 
`wait_for_termination=False` and uses `execute_trigger_complete` as the first 
callback.
   > * In `execute_trigger_complete`, behavior branches by 
`wait_for_completion`:
   >   
   >   * if `False`, it returns immediately (fire-and-forget).
   >   * if `True`, it defers again to `PowerBITrigger` with 
`wait_for_termination=True`, with `execute_complete` as the second callback.
   > 
   > So `wait_for_completion` now controls whether we stop after the first 
callback or continue to a second deferred wait step.
   
   Really like the refactor you did here, much better and more deferrable 
oriented without blocking code.  I think we are almost there, good job!



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