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


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -117,40 +116,56 @@ def api_version(self) -> str | None:
 
     def execute(self, context: Context):
         """Refresh the Power BI Dataset."""
-        if not self.wait_for_completion:
-            # Fire and forget - synchronous execution, no deferral
-            hook = PowerBIHook(
-                conn_id=self.conn_id, proxies=self.proxies, 
api_version=self.api_version, timeout=self.timeout
-            )
-
-            dataset_refresh_id = hook.trigger_dataset_refresh(
-                dataset_id=self.dataset_id,
+        self.defer(
+            trigger=PowerBITrigger(
+                conn_id=self.conn_id,
                 group_id=self.group_id,
+                dataset_id=self.dataset_id,
+                timeout=self.timeout,
+                proxies=self.proxies,
+                api_version=self.api_version,
+                check_interval=self.check_interval,
+                wait_for_termination=False,
                 request_body=self.request_body,
+            ),
+            method_name=self.execute_trigger_complete.__name__,
+        )
+
+    def execute_trigger_complete(self, context: Context, event: dict[str, str] 
| None) -> None:

Review Comment:
   > Maybe rename to handle_refresh or continue_refresh or execute_refresh?
   > 
   > So then we have 2 next methods:
   > 
   > * handle_refresh or continue_refresh or execute_refresh (stating the we 
awaited the trigger and need to await refresh again)
   > * execute_complete (the whole refresh process is now completed)
   > 
   > execute_trigger_complete ressembles too much to execute_complete, even 
though I know what's it's for a better functional name would be more adviced in 
this case.
   
   Thanks dabla! I will use `handle_refresh`.



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