File tree Expand file tree Collapse file tree
integrations/qdrant/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,23 @@ def test_init_is_lazy(self):
3939 QdrantDocumentStore (location = ":memory:" , use_sparse_embeddings = True )
4040 mocked_qdrant .assert_not_called ()
4141
42+ def test_prepare_client_params_no_mutability (self ):
43+ metadata = {"key" : "value" }
44+ doc_store = QdrantDocumentStore (
45+ ":memory:" ,
46+ recreate_index = True ,
47+ return_embedding = True ,
48+ wait_result_from_api = True ,
49+ use_sparse_embeddings = False ,
50+ metadata = metadata ,
51+ )
52+ client_params = doc_store ._prepare_client_params ()
53+ # Mutate value of metadata in client_params
54+ client_params ["metadata" ] = client_params ["metadata" ].update ({"new_key" : "new_value" })
55+
56+ # Assert that the original metadata in the document store is unchanged
57+ assert metadata == {"key" : "value" }
58+
4259 def test_to_dict (self , monkeypatch ):
4360 monkeypatch .setenv ("QDRANT_API_KEY" , "test_api_key" )
4461 doc_store = QdrantDocumentStore (
You can’t perform that action at this time.
0 commit comments