henry3260 commented on PR #63829:
URL: https://github.com/apache/airflow/pull/63829#issuecomment-4097336022

   > Hello @henry3260,
   > 
   > thank you for your effort! I tried to run the updated provider in our test 
instance. Unfortunately, I still have an issue with wait_for_completion=False. 
   > 
   > Currently I am receiving an AirflowNotFoundException connection error. See 
:
   > 
   > 
   > 
   > ```
   > 
   > PowerBIDatasetRefreshException: Failed to trigger dataset refresh.
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py",
 line 1068 in run
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py",
 line 1477 in _execute_task
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/bases/operator.py", 
line 417 in wrapper
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/operators/powerbi.py",
 line 126 in execute
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/powerbi.py",
 line 201 in trigger_dataset_refresh_sync
   > 
   > File "/appl/airflow/lib/lib/python3.12/asyncio/runners.py", line 195 in run
   > 
   > File "/appl/airflow/lib/lib/python3.12/asyncio/runners.py", line 118 in run
   > 
   > File "/appl/airflow/lib/lib/python3.12/asyncio/base_events.py", line 691 
in run_until_complete
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/powerbi.py",
 line 236 in trigger_dataset_refresh
   > 
   > AirflowNotFoundException: The conn_id `PowerBI_Con8` isn't defined
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/powerbi.py",
 line 222 in trigger_dataset_refresh
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/msgraph.py",
 line 511 in run
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/msgraph.py",
 line 583 in send_request
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/microsoft/azure/hooks/msgraph.py",
 line 404 in get_async_conn
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/providers/common/compat/connection/__init__.py",
 line 43 in get_async_connection
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/bases/hook.py", 
line 75 in aget_connection
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/definitions/connection.py",
 line 234 in async_get
   > 
   > File 
"/appl/airflow/lib/lib/python3.12/site-packages/airflow/sdk/execution_time/context.py",
 line 220 in _async_get_connection
   > 
   > ```
   > 
   > 
   > 
   > The connection is defined directly in UI. In case the wait_for_completion 
is set to True, DAG works fine. So, it seems that once you run it synchronously 
through asyncio.run() then get_async_conn does not work properly. 
   > 
   > 
   > 
   > I did a quick test to test this behaviour. I changed line 583 in msgraph 
hook in method `send_request`. Instead of `conn = await self.get_async_conn()` 
I tried to use deprecated `conn = self.get_conn()`. 
   > 
   > 
   > 
   > Then wait_for_completion works fine - even for True or False
   
   Hi @morelgeorge! Thanks for the information! I think this version is better 
and will avoid the above error.


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