File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -315,10 +315,9 @@ def get_server_type(host: str):
315315
316316
317317def dumps (v : Union [dict , str ]) -> str :
318- # Use JSON serialization for dicts and booleans to ensure consistent formatting
319- # (e.g., booleans are serialized as 'true'/'false' not 'True'/'False')
320- # For other types (strings, numbers), use str() to maintain compatibility
321- if isinstance (v , (dict , bool )):
318+ # Use JSON serialization for dicts to ensure proper formatting
319+ # For other types (strings, numbers, booleans), use str() to maintain compatibility
320+ if isinstance (v , dict ):
322321 return orjson .dumps (v ).decode (Config .EncodeProtocol )
323322 return str (v )
324323
Original file line number Diff line number Diff line change @@ -554,7 +554,8 @@ def test_create_index_request_with_false_boolean_param(self):
554554 param_values = {p .key : p .value for p in req .extra_params }
555555
556556 assert "with_raw_data" in param_keys , "with_raw_data parameter should be included"
557- assert param_values ["with_raw_data" ] == "false" , "with_raw_data should be serialized as 'false'"
557+ # Short-term fix: booleans are serialized as uppercase "False"/"True" for e2e compatibility
558+ assert param_values ["with_raw_data" ] == "False" , "with_raw_data should be serialized as 'False'"
558559 assert "index_type" in param_keys
559560 # String values are serialized as plain strings (without quotes) for compatibility
560561 assert param_values ["index_type" ] == "SCANN" , "index_type should be serialized as plain string"
@@ -576,7 +577,8 @@ def test_create_index_request_with_true_boolean_param(self):
576577 param_values = {p .key : p .value for p in req .extra_params }
577578
578579 assert "with_raw_data" in param_keys , "with_raw_data parameter should be included"
579- assert param_values ["with_raw_data" ] == "true" , "with_raw_data should be serialized as 'true'"
580+ # Short-term fix: booleans are serialized as uppercase "False"/"True" for e2e compatibility
581+ assert param_values ["with_raw_data" ] == "True" , "with_raw_data should be serialized as 'True'"
580582 assert param_values ["index_type" ] == "SCANN" , "index_type should be serialized as plain string"
581583 assert param_values ["metric_type" ] == "L2" , "metric_type should be serialized as plain string"
582584
You can’t perform that action at this time.
0 commit comments