You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "shreyas-dev (via GitHub)" <gi...@apache.org> on 2026/01/10 13:20:02 UTC
[PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
shreyas-dev opened a new pull request, #60369:
URL: https://github.com/apache/airflow/pull/60369
## Description
This PR adds an optional `wait_for_termination` parameter to `PowerBIDatasetRefreshOperator` and refactors the execution flow to fix the double-deferral anti-pattern present in the current implementation.
## Motivation and Context
**New Feature:**
Users need the ability to trigger Power BI dataset refreshes without waiting for completion. This is useful for:
- Long-running refreshes (hours/days) that don't need to block the DAG
- Scenarios where downstream tasks don't depend on refresh completion
- Reducing worker slot usage for fire-and-forget operations
**Bug Fix:**
The current implementation uses an inefficient double-deferral pattern:
1. `execute()` → defer → triggers refresh and returns `dataset_refresh_id`
2. `get_refresh_status()` → defer again → polls for completion
3. `execute_complete()` → processes final result
This is unnecessary because `PowerBITrigger.run()` already handles both triggering the refresh AND polling for completion in a single async operation when `wait_for_termination=True`.
## Was generative AI tooling used to co-author this PR?
- No
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2708649216
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Yes, but I agree with @eladkal , the existing deferrable parameter is confusing. The new parameter I’m fine with, but maybe it’s not needed at all. I think deferrable should be deprecated as in my opinion it doesn’t make sense. I would make the waiting purely in deferrable mode and remove the blocking part and keep the new part you did @shreyas-dev as this is how it should have been implemented from the beginning. I willl check back tonight and come back to you.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3849065777
Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2703625377
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
> Regardless of what is happening under the hood. The operator parameters should be: wait_for_termination -> wait in sync deferrable -> wait async using PowerBITrigger
>
> We should align the operator accordingly.
>
> > Add synchronous wrapper methods to the hook
>
> That should be easy unless i am missing something. You can just do what is already implemented in any of the aws hooks. The only difference is the API call to get the updated status. Am I wrong?
@eladkal Probably the operator has to much responsability and the operations should have been split between operator and sensor?
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
> Regardless of what is happening under the hood. The operator parameters should be: wait_for_termination -> wait in sync deferrable -> wait async using PowerBITrigger
>
> We should align the operator accordingly.
>
> > Add synchronous wrapper methods to the hook
>
> That should be easy unless i am missing something. You can just do what is already implemented in any of the aws hooks. The only difference is the API call to get the updated status. Am I wrong?
@eladkal Probably the operator has to much responsibility and the operations should have been split between operator and sensor?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3842398732
The failed test doesn't look to be related to this PR https://github.com/apache/airflow/actions/runs/21616745897/job/62362457618?pr=60369
```
Host python version is 3.10.19 (main, Oct 10 2025, 01:02:36) [GCC 11.4.0]
The image /mnt/ci-image-save-v3-linux_amd64-3.10.tar does not exist.
Error: Process completed with exit code 1.
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2705244986
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
It's not a limitation or missing implementation, it' just that the hook is fully async, so you're bound to the trigger mechanism to execute it or you would need to use asyncio.run but that would be ugly, so it's best to use the defer mechanism here, but when the operators has to chain 2 operations, then that means 2 defers, hence why @shreyas-dev introduced the `wait_for_termination` parameter. I would definitely **NOT** add the `deferrable` parameter, as all operations are already deferred.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3848510815
Hey @vincbeck, Apologies I have fixed the test case and verified all the test cases by running it locally.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3836471647
Hey @vincbeck , I'm guessing structlog was introduced in airflow 3+ and airflow 2.11 used standard logging. How to resolve this issue? On the contrary I'm now thinking of removing the warning cause Its a just informational message.
```python
logger.warning(
"The PowerBIDatasetRefreshOperator now always uses deferrable execution when wait_for_termination=True."
)
```
In this case I can remove structlog entirely
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2707881898
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
My comment is non-blocking.
@dabla is the expert on Azure related code so he can proceed with merge if he is happy with the code
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2708669587
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
The reason why Ivwoildbremove rhe blocking part entirely is that it’s not a good practise in Airflow. Polling should be handled by triggers, as that’s what they are designed for, because otherwise it means you block a worker slot in Airflow, which in reality does nothing except waiting for a response, thus in my opinion remove the blocking part and replace it purely with deferrable (e.g. Polling in trigger) is a much better solution imho. Therefor I would deprecrate the deferrable parameter, log a warning it’s not used anymore and just do deferred. WDYT @eladkal ?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2700941402
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Regardless of what is happening under the hood. The operator parameters should be:
wait_for_termination -> wait in sync
deferrable -> wait async using PowerBITrigger
We should align the operator accordingly.
> Add synchronous wrapper methods to the hook
That should be easy unless i am missing something. You can just do what is already implemented in any of the aws hooks. The only difference is the API call to get the updated status. Am I wrong?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2705834897
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
> Agreed with @dabla. We need to re-write the entire Hook and the Trigger to support both sync and async.
I would certainly not support sync with an async library, doesn’t make sense imho.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3747773043
Hey @vincbeck/@dabla, Please check
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2678769323
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +86,14 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
Please add a docstring
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2765337968
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
I just realized this PR is not related to AWS provider ... Sorry about that, matter of habit ... But it is not a big deal, I think my comment is still valid
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2699137186
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
I find this a bit confusing(?)
We need to have both `wait_for_termination` and `deferrable` similar to how we do it with other operators
https://github.com/apache/airflow/blob/fdd12cfde230ca178e14f8ba4a4cbaaba1f0806a/providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py#L91-L97
both are considered as waiting for completion it just that one holds worker and the other does not.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2759983142
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
Hey @vincbeck , I can see `wait_for_completion` being used in multiple aws operators, Can you please elaborate a little as to what has to be done?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3750935891
Hey @vincbeck , Resolved www-hash.txt.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2708649216
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Yes, but I agree with @eladkal , the existing deferrable parameter is confusing. The new parameter I’m fine with, but maybe it’s not needed at all. I think deferrable should be deprecated as in my opinion it doesn’t make sense. I would make the waiting purely in deferrable mode and remove the blocking part and keep the new part you did @shreyas-de as this is how it should have been implemented from the beginning. I willl check back tonight and come back to you.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2703688224
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
> @eladkal Probably the operator has to much responsibility and the operations should have been split between operator and sensor?
The pattern of operators that also holds workers is fine. If we don't have a sensor we can add it regardless.
> Problem is wait in sync is not really possible, as @shreyas-dev explained, the hook is fully async and the deferrable parameter wouldn't really make sense as it is deferrable already and only runs is deferrable mode.
Is this a limitation from upstream or missing implimitation in Airflow?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck merged PR #60369:
URL: https://github.com/apache/airflow/pull/60369
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2739679820
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Hey @dabla , We can't deprecate `deferrable` parameter as it's part of airflow core, I added a warning saying "The PowerBIDatasetRefreshOperator now always uses deferrable execution when wait_for_termination=True.".
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2759608445
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
We usually use `wait_for_completion` in the AWS provider package. Can you please use it as well for consistency purposes?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2690638234
##########
providers/fab/www-hash.txt:
##########
@@ -1 +1 @@
-520ca3c6fbd1d56da78a694078f7b70645913b641552f0235b73c9162d45a74d
Review Comment:
This file should not be modified
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2739681903
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
@dabla can you help me close this PR please?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2708669587
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
The reason why I would remove the blocking part entirely is that it’s not a good practise in Airflow. Polling should be handled by triggers, as that’s what they are designed for, because otherwise it means you block a worker slot in Airflow, which in reality does nothing except waiting for a response, thus in my opinion remove the blocking part and replace it purely with deferrable (e.g. Polling in trigger) is a much better solution imho. Therefor I would deprecrate the deferrable parameter, log a warning it’s not used anymore and just do deferred. WDYT @eladkal ?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3822640205
@dabla , Let me know if anything else is needed to get this merged.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3831101817
Ran `prek --all-files` locally and all results passed
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3836570362
> Hey @vincbeck , I'm guessing structlog was introduced in airflow 3+ and airflow 2.11 used standard logging. How to resolve this issue? On the contrary I'm now thinking of removing the warning cause Its a just informational message.
>
> ```python
> logger.warning(
> "The PowerBIDatasetRefreshOperator now always uses deferrable execution when wait_for_termination=True."
> )
> ```
>
> In this case I can remove structlog entirely
Can you check ho it is done in the other providers?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3838957326
Hey @vincbeck, Updated the code.`prek --all-files` was successful locally. Please check
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2703625377
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
> Regardless of what is happening under the hood. The operator parameters should be: wait_for_termination -> wait in sync deferrable -> wait async using PowerBITrigger
>
> We should align the operator accordingly.
>
> > Add synchronous wrapper methods to the hook
>
> That should be easy unless i am missing something. You can just do what is already implemented in any of the aws hooks. The only difference is the API call to get the updated status. Am I wrong?
Probably the operator has to much responsability and the operations should have been split between operator and sensor?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2764347425
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
Hey @vincbeck, changed `wait_for_termination` to `wait_for_completion`. `prek --all-files` was succesfully
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3744603116
Hey @dabla and @shahar1, Added `wait_for_termination` to docstring, please review.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2691496128
##########
providers/fab/www-hash.txt:
##########
@@ -1 +1 @@
-520ca3c6fbd1d56da78a694078f7b70645913b641552f0235b73c9162d45a74d
Review Comment:
This was generated by prek. I revert this back
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3745754576
Hey @dabla, fixed "imperative mood" docstring test case which was failing.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2700818580
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Hey @eladkal, I completely agree that having both wait_for_termination and deferrable parameters would provide better flexibility. However, I've realized that implementing this properly would require some significant refactoring:
1. The PowerBIHook class is currently fully async, with methods like trigger_dataset_refresh() and get_refresh_details_by_refresh_id() being async
2. To support synchronous waiting (wait_for_termination=True, deferrable=False), we'd need to either:
- Add synchronous wrapper methods to the hook
- Redesign parts of the hook to support both sync and async patterns. This would also impact the trigger implementation.
I'd like to propose handling this as a separate feature enhancement in a follow-up PR and keep this as just `wait_for_termination` feature implementation as the original title suggested. If I get little bit of time I'll work on it in the next couple of days and raise another PR. It's up to you guys to decide.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3760512062
Hey @vincbeck,
```
_____________________________________________________________________________ TestAwsS3Hook.test_sync_to_local_dir_behaviour _____________________________________________________________________________
[gw1] linux -- Python 3.10.19 /usr/python/bin/python
providers/amazon/tests/unit/amazon/aws/hooks/test_s3.py:1840: in test_sync_to_local_dir_behaviour
assert "S3 object size" in logs_string
E AssertionError: assert 'S3 object size' in 'Downloading data from s3://airflow-test-s3-bucket/ to /tmp/pytest-of-root/pytest-0/popen-gw1/test_sync_to_local_dir_b...al_dir_behavio0/s3_sync_dir/subproject1/dag_b.py is up-to-date with S3 object subproject1/dag_b.py. Skipping download.'
```
This test case failure looks unrelated to this PR. I have updated my branch. Can you please check ?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2705543893
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Agreed with @dabla. We need to re-write the entire Hook and the Trigger to support both sync and async.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2699137186
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
I find this a bit confusing(?)
We need to have both `wait_for_termination` and `deferrable` similar to how we do it with other operators
https://github.com/apache/airflow/blob/fdd12cfde230ca178e14f8ba4a4cbaaba1f0806a/providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py#L91
both are considered as waiting for completion it just that one holds worker and the other does not.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2678796404
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +86,14 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
**kwargs,
) -> None:
super().__init__(**kwargs)
self.hook = PowerBIHook(conn_id=conn_id, proxies=proxies, api_version=api_version, timeout=timeout)
self.dataset_id = dataset_id
self.group_id = group_id
- self.wait_for_termination = True
+ self.wait_for_termination = wait_for_termination
Review Comment:
Congratulations @shreyas-dev, looking good to me beside the remark made by @shahar1 I think where are good nice improvement.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2701052983
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Problem is wait in sync is not really possible, as @shreyas-dev explained, the hook is fully async and the deferrable parameter wouldn't really make sense as it is deferrable already and only runs is deferrable mode.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "dabla (via GitHub)" <gi...@apache.org>.
dabla commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2705244986
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
It's not a limitation or missing implementation, it' just that the hook is fully async, so you're bound to the trigger mechanism to execute it or you would need to use asyncio.run but that would be ugly, so it's best to use the defer mechanism here, but when the operators has to chain 2 operations, then that means 2 defers, hence why @shreyas-dev introduced the `wait_for_termination` parameter.
I would definitely **NOT** add the `deferrable` parameter, as all operations are already deferred.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2707789661
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -65,6 +65,7 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
:param check_interval: Number of seconds to wait before rechecking the
refresh status.
:param request_body: Additional arguments to pass to the request body, as described in https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group#request-body.
+ :param wait_for_termination: If True, wait for the dataset refresh to complete. If False, trigger the refresh and return immediately without waiting.
Review Comment:
Can we resolve this? @dabla @eladkal
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3824562751
Used `structlog` instead of `logging`.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2760020633
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
Here you are using `wait_for_termination`, I would rather use `wait_for_completion` instead for consistency purposes. I think it is better/easier for users if operators within a same package (here AWS) follow the same naming convention.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "shreyas-dev (via GitHub)" <gi...@apache.org>.
shreyas-dev commented on code in PR #60369:
URL: https://github.com/apache/airflow/pull/60369#discussion_r2762485282
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:
##########
@@ -86,13 +89,19 @@ def __init__(
api_version: APIVersion | str | None = None,
check_interval: int = 60,
request_body: dict[str, Any] | None = None,
+ wait_for_termination: bool = True,
Review Comment:
Makes sense. Will do the change.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add wait_for_termination parameter and fix double-deferral in PowerBIDatasetRefreshOperator [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #60369:
URL: https://github.com/apache/airflow/pull/60369#issuecomment-3732744601
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org