omar-massfih commented on code in PR #74600:
URL: https://github.com/apache/airflow/pull/74600#discussion_r4270011278
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/powerbi.py:
##########
@@ -187,6 +195,39 @@ async def get_refresh_details_by_refresh_id(
refresh_details = refresh_histories[refresh_ids.index(refresh_id)]
+ if refresh_details.get(PowerBIDatasetRefreshFields.REFRESH_TYPE.value)
== "ViaEnhancedApi":
+ try:
+ execution_details = await self.run(
+
url="myorg/groups/{group_id}/datasets/{dataset_id}/refreshes/{refresh_id}",
+ path_parameters={
+ "group_id": group_id,
+ "dataset_id": dataset_id,
+ "refresh_id": refresh_id,
+ },
+ )
+ except AirflowException as error:
+ raise PowerBIDatasetRefreshException(
+ "Failed to retrieve refresh execution details"
+ ) from error
+ status = execution_details.get("extendedStatus")
+ if status not in PowerBIDatasetRefreshStatus.TERMINAL_STATUSES |
{"NotStarted", "InProgress"}:
Review Comment:
Added `ACTIVE_EXTENDED_STATUSES` and normalized `NotStarted`, `InProgress`,
and `Unknown` to `In Progress`. Extended-status precedence is preserved.
Timeout tests cover all three values; trigger event fields and XCom keys are
unchanged.
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/powerbi.py:
##########
@@ -187,6 +195,39 @@ async def get_refresh_details_by_refresh_id(
refresh_details = refresh_histories[refresh_ids.index(refresh_id)]
+ if refresh_details.get(PowerBIDatasetRefreshFields.REFRESH_TYPE.value)
== "ViaEnhancedApi":
+ try:
+ execution_details = await self.run(
+
url="myorg/groups/{group_id}/datasets/{dataset_id}/refreshes/{refresh_id}",
+ path_parameters={
+ "group_id": group_id,
+ "dataset_id": dataset_id,
+ "refresh_id": refresh_id,
+ },
+ )
+ except AirflowException as error:
+ raise PowerBIDatasetRefreshException(
+ "Failed to retrieve refresh execution details"
+ ) from error
+ status = execution_details.get("extendedStatus")
+ if status not in PowerBIDatasetRefreshStatus.TERMINAL_STATUSES |
{"NotStarted", "InProgress"}:
+ status = execution_details.get("status")
+ errors = [message["message"] for message in
execution_details.get("messages", [])]
Review Comment:
The parser now skips missing, null, and empty message text and excludes
warnings. Untyped messages and top-level and attempt-level service exceptions
are preserved. Messages never determine terminal status.
The active-to-completed regression includes a message without text and
verifies cancellation is never awaited. All three active-status cases failed
before the fix and now pass.
The supplied live pair returned HTTP 200 and `Completed` from both
endpoints, validating normal completion only. The stuck-history condition
remains unreproduced; failure and divergence coverage is synthetic.
--
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]