amoghrajesh commented on code in PR #76793:
URL: https://github.com/apache/airflow/pull/76793#discussion_r4546167841
##########
providers/microsoft/azure/tests/unit/microsoft/azure/operators/test_powerbi.py:
##########
@@ -509,6 +510,24 @@ def
test_execute_preserves_refresh_when_execution_details_fail(
mock_cancel_dataset_refresh.assert_not_awaited()
assert task_state_store.values == {REFRESH_ID_KEY:
PREVIOUS_REFRESH_REQUEST_ID}
+ def test_durable_is_named_on_init_rather_than_left_to_kwargs(self):
+ """Below 3.3 the compat ResumableJobMixin.__init__ has no
`_apply_defaults` wrapper, so
+ `default_args` only reaches `durable` when the operator names it."""
+ init = PowerBIDatasetRefreshOperator.__init__
+ signature = inspect.signature(getattr(init, "__wrapped__", init))
+ assert "durable" in signature.parameters
+
+ @pytest.mark.parametrize("durable", [False, True])
+ def test_default_args_durable_reaches_operator(self, durable):
+ with DAG(
+ dag_id="test_powerbi_durable_default_args",
+ schedule=None,
+ start_date=DEFAULT_DATE,
+ default_args={"durable": durable},
+ ):
+ operator = PowerBIDatasetRefreshOperator(**CONFIG)
+ assert operator.durable is durable
Review Comment:
Thnx, I just split it: the False check is now gated on 3.3+, and a new below
3.3 test asserts the warning fires from `default_args={"durable": 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]