fix: consistency_level to return human-readable string#3267
fix: consistency_level to return human-readable string#3267veeceey wants to merge 2 commits intomilvus-io:masterfrom
Conversation
|
Welcome @veeceey! It looks like this is your first PR to milvus-io/pymilvus 🎉 |
|
/assign @longjiquan |
4eaf8a3 to
9cb3025
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: veeceey The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @longjiquan, friendly ping on this PR. It's been open for about 10 days and is awaiting your review/approval. Would appreciate any feedback when you have a moment. Thank you! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3267 +/- ##
=======================================
Coverage 76.21% 76.21%
=======================================
Files 63 63
Lines 13292 13296 +4
=======================================
+ Hits 10130 10134 +4
Misses 3162 3162 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@veeceey Please fix the code checker |
|
On it @XuanYang-cn — looking into the code checker failure now and will push a fix. |
…lection Fixes milvus-io#2985 When calling describe_collection(), the consistency_level field was returning a numeric value (0, 1, 2, 3, 4) instead of a human-readable string ("Strong", "Session", "Bounded", "Eventually", "Customized"). This made the output not user-friendly and required users to manually map the integer to its semantic meaning. Changes: - Added _consistency_level_to_str() helper method to CollectionSchema - Maps ConsistencyLevel enum integers to their string names - Falls back to returning the int if an unknown value is encountered - Updated dict() method to use the helper when building the response Before: {'consistency_level': 0, ...} After: {'consistency_level': 'Strong', ...} Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
eb2df71 to
7efb5f7
Compare
|
Fixed -- rebased to add the DCO sign-off that was missing on the second commit. Should be green now. |
Fixes #2985
Summary
When calling
describe_collection(), theconsistency_levelfield was returning a numeric value (0, 1, 2, 3, 4) instead of a human-readable string ("Strong", "Session", "Bounded", "Eventually", "Customized").This made the output not user-friendly and required users to manually map the integer to its semantic meaning.
Changes
_consistency_level_to_str()helper method toCollectionSchemaclassConsistencyLevelenum integers to their string namesdict()method to use the helper when building the responseBefore
{ 'collection_name': 'client_geometry_3yiyc8Bb', 'consistency_level': 0, # Not user-friendly! ... }After
{ 'collection_name': 'client_geometry_3yiyc8Bb', 'consistency_level': 'Strong', # Human-readable! ... }Test Plan
The fix converts all consistency level enum values correctly:
0→"Strong"1→"Session"2→"Bounded"3→"Eventually"4→"Customized"Existing tests in
tests/grpc_handler/test_collection.pyverifydescribe_collection()functionality and will validate this change.