-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Allow custom api versions in MSGraphAsyncOperator #41331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… pipelines in MS Fabric
|
@potiuk Could this one also be merged? It allows using custom API versions, everything seems fine and already tested this solution in our local environment. |
|
Of course. It's just a metter of making tests pass. |
|
You will need to make some tests db -tests and apparently |
Still, weird those tests start failing now while those where merged by another PR. |
What I see now is that "test_powerbi" fails - which it looks it needs "power_bi" connection from the DB - so it should be 'db test" - i am not sure if see other "merged" things that influence it ? |
Should I just create a Connection instance like for example in test_mssql.py at top of the file? |
|
@potiuk I would also like to have this PR merged for the next providers release as this fixes also fixes proxy issue with PowerBIDatasetRefreshOperator and allows custom api versions to be specified. |
|
Tests failing though |
Yes I'm working on it ;) |
|
@potiuk I think the PR is ready now |
|
Indeed. |
Thanks @potiuk |
| @pytest.mark.asyncio | ||
| @mock.patch(f"{MODULE}.hooks.powerbi.PowerBIHook.get_refresh_details_by_refresh_id") | ||
| @mock.patch(f"{MODULE}.hooks.powerbi.PowerBIHook.trigger_dataset_refresh") | ||
| async def test_powerbi_trigger_run_timeout( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dabla I just checked some tests and realized that this test added in this PR always needs 30 seconds - presumably because of the TIMEOUT being defined =30 above.
This is not really acceptable and I propose to use a better method such that the pytest does not run 30 seconds.
Can you please improve this? THANKS.
If you want to test the runtime, you can check selectively via breeze testing tests --test-type "Providers[microsoft]" -- providers/tests/microsoft/azure/triggers/test_powerbi.py::TestPowerBITrigger::test_powerbi_trigger_run_timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m willing to look at it but I think this test was originally added by @ambika-garg as this is regarding the PowerBi operator, not the MSGraphOperator. Those tests were probably updated by me due to the change of api version definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jscheffl, Thank you for reviewing it. I will look into this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jscheffl, Thank you for reviewing it. I will look into this test.
Thank you @ambika-garg for looking into it.
We also use the MSGraphAsyncOperator to trigger Fabric pipelines, unfortunately the MS Fabric REST API doesn't follow the same versioning convention like MS Graph or PowerBI. In MS Graph and PowerBI, the version is v1.0, while in Fabric it is v1. So in order to be able to also invoke MS Fabric endpoints, we had to define the absolute URL instead of the relative one in order to make it work, as with relative url's we where unable to specify v1 as api_version. This PR solves this issue.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.