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 @@ -316,10 +316,9 @@ def get_server_type(host: str):
316316
317317
318318def dumps (v : Union [dict , str ]) -> str :
319- # Use JSON serialization for dicts and booleans to ensure consistent formatting
320- # (e.g., booleans are serialized as 'true'/'false' not 'True'/'False')
321- # For other types (strings, numbers), use str() to maintain compatibility
322- if isinstance (v , (dict , bool )):
319+ # Use JSON serialization for dicts to ensure proper formatting
320+ # For other types (strings, numbers, booleans), use str() to maintain compatibility
321+ if isinstance (v , dict ):
323322 return orjson .dumps (v ).decode (Config .EncodeProtocol )
324323 return str (v )
325324
Original file line number Diff line number Diff line change @@ -553,7 +553,8 @@ def test_create_index_request_with_false_boolean_param(self):
553553 param_values = {p .key : p .value for p in req .extra_params }
554554
555555 assert "with_raw_data" in param_keys , "with_raw_data parameter should be included"
556- assert param_values ["with_raw_data" ] == "false" , "with_raw_data should be serialized as 'false'"
556+ # Short-term fix: booleans are serialized as uppercase "False"/"True" for e2e compatibility
557+ assert param_values ["with_raw_data" ] == "False" , "with_raw_data should be serialized as 'False'"
557558 assert "index_type" in param_keys
558559 # String values are serialized as plain strings (without quotes) for compatibility
559560 assert param_values ["index_type" ] == "SCANN" , "index_type should be serialized as plain string"
@@ -575,7 +576,8 @@ def test_create_index_request_with_true_boolean_param(self):
575576 param_values = {p .key : p .value for p in req .extra_params }
576577
577578 assert "with_raw_data" in param_keys , "with_raw_data parameter should be included"
578- assert param_values ["with_raw_data" ] == "true" , "with_raw_data should be serialized as 'true'"
579+ # Short-term fix: booleans are serialized as uppercase "False"/"True" for e2e compatibility
580+ assert param_values ["with_raw_data" ] == "True" , "with_raw_data should be serialized as 'True'"
579581 assert param_values ["index_type" ] == "SCANN" , "index_type should be serialized as plain string"
580582 assert param_values ["metric_type" ] == "L2" , "metric_type should be serialized as plain string"
581583
You can’t perform that action at this time.
0 commit comments