jason810496 opened a new pull request, #69798:
URL: https://github.com/apache/airflow/pull/69798

   - related: #69785
   
   ## Why
   
   
`TestAzureDataFactoryAsyncHook::test_get_pipeline_run_exception_without_resource`
 fails on main in the uncapped-dependency CI jobs with `ModuleNotFoundError: No 
module named 'azure.mgmt.datafactory.models._models_py3'` — the regenerated 
`azure-mgmt-datafactory` 10.0.0 removed that private module, and the test 
`mock.patch`es a class inside it at run time (#69785 fixed the collection-time 
break in the same file, but this run-time patch was left behind).
   
   ## What
   
   - Drop the 
`@mock.patch("azure.mgmt.datafactory.models._models_py3.PipelineRun")` 
decorator and use a plain `MagicMock()` as the mocked `pipeline_runs.get` 
return value. The value is an opaque placeholder — the test asserts 
`get_pipeline_run` raises before the connection is ever used — so the test no 
longer depends on any specific SDK module layout and passes on both 9.3.0 
(locked) and 10.0.0.
   
   ## Verification
   
   - `uv run --project providers/microsoft/azure --with 
"azure-mgmt-datafactory==10.0.0" pytest 
providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_data_factory.py 
-q` → 78 passed (the unfixed test fails on 10.0.0 with the CI error)
   - `uv run --project providers/microsoft/azure pytest 
providers/microsoft/azure/tests/unit/microsoft/azure/hooks/test_data_factory.py 
-q` → 78 passed on locked 9.3.0
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code (Fable 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to