From 477371da3aeee71fceeae5dbba36ba5edcaf4085 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 17 Apr 2024 18:22:48 +0200 Subject: [PATCH] fix: do not convert bytes --- qdrant_client/local/local_collection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qdrant_client/local/local_collection.py b/qdrant_client/local/local_collection.py index c3b6ea4f..60325626 100644 --- a/qdrant_client/local/local_collection.py +++ b/qdrant_client/local/local_collection.py @@ -83,8 +83,11 @@ def convert_nan_inf_to_null(obj: Any) -> Any: if isinstance(obj, dict): return {k: convert_nan_inf_to_null(v) for k, v in obj.items()} + if isinstance(obj, str) or isinstance(obj, bytes) or isinstance(obj, range): + return obj + # pydantic converts iterables to lists - elif isinstance(obj, Iterable) and not (isinstance(obj, str) or isinstance(obj, range)): + if isinstance(obj, Iterable): return [convert_nan_inf_to_null(v) for v in obj] return obj