Repository navigation
make tests order independent - #40953
Conversation
There was a problem hiding this comment.
📋 Review Summary
This PR improves test stability by making stdout assertions in mltransform_test.py order-independent and adding proper HTTP status checking, error payload validation, and pre-flight availability checks for the Hugging Face Inference API in huggingface.py and huggingface_test.py. The changes are clean, well-scoped, and effectively address potential test flakes.
🔍 General Feedback
- In
mltransform_test.py, switching toassertCountEqualfor vocabulary computation tests makes sense since pipeline execution does not guarantee element print ordering (consider applying the same totest_mltransform_scale_to_0_1if it can also experience out-of-order execution). - The error handling additions in
_InferenceAPIHandler.run_inference(raise_for_status()and checking for'error'in the response dict) prevent API error payloads from silently passing through as embedding outputs.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @jrmccluskey for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
R: @Abacn |
|
assign to next reviewer |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40953 +/- ##
==========================================
+ Coverage 79.83% 80.09% +0.26%
==========================================
Files 494 494
Lines 83575 83614 +39
==========================================
+ Hits 66722 66972 +250
+ Misses 16853 16642 -211
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
assign set of reviewers |
|
Assigning reviewers: R: @jrmccluskey for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
PostCommit Python Dependency checks passed |
Fixes: #30799
PostCommit Python Dependency failing on embeddings + tft-121.
HF: with a token set the provider can still reject, and it was treated {"error":...} as embeddings ((5, False)). Raise on that, and skip the live test if the API isn't usable.
TFT: vocab stdout tests flake on print order so switch those two to assertCountEqual.