File tree Expand file tree Collapse file tree
integrations/elasticsearch/src/haystack_integrations/document_stores/elasticsearch Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
22#
33# SPDX-License-Identifier: Apache-2.0
4-
4+ import copy
55# ruff: noqa: FBT002, FBT001 boolean-type-hint-positional-argument and boolean-default-value-positional-argument
66# ruff: noqa: B008 function-call-in-default-argument
77# ruff: noqa: S101 disable checks for uses of the assert keyword
@@ -143,6 +143,7 @@ def __init__(
143143 raise ValueError (msg )
144144
145145 if self ._custom_mapping and self ._sparse_vector_field :
146+ self ._custom_mapping = copy .deepcopy (custom_mapping ) # original custom_mapping dict is left unchanged
146147 self ._custom_mapping .setdefault ("properties" , {})
147148 self ._custom_mapping ["properties" ][self ._sparse_vector_field ] = {"type" : "sparse_vector" }
148149
You can’t perform that action at this time.
0 commit comments