chore: Deprecate deserialize_document_store_in_init_params_inplace (#10442)

* add release note

* Apply suggestion from @anakin87

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>

* mention 2.24 in release note

* mention version 2.24 in deprecation warning

---------

Co-authored-by: Stefano Fiorucci <stefanofiorucci@gmail.com>
This commit is contained in:
Julian Risch
2026-01-23 17:35:20 +01:00
committed by GitHub
parent 5e789ecfb7
commit a03b6fcbae
2 changed files with 17 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0
import warnings
from typing import Any
from haystack.core.errors import DeserializationError
@@ -12,6 +13,10 @@ def deserialize_document_store_in_init_params_inplace(data: dict[str, Any], key:
"""
Deserializes a generic document store from the init_parameters of a serialized component in place.
.. deprecated:: 2.23.0
This function is deprecated and will be removed in Haystack version 2.24.
It is no longer used internally and should not be used in new code.
:param data:
The dictionary to deserialize from.
:param key:
@@ -22,6 +27,13 @@ def deserialize_document_store_in_init_params_inplace(data: dict[str, Any], key:
:raises DeserializationError:
If the document store is not properly specified in the serialization data or its type cannot be imported.
"""
warnings.warn(
"`deserialize_document_store_in_init_params_inplace` is deprecated. "
"It will be removed in Haystack version 2.24. "
"It is no longer used internally and should not be used in new code.",
DeprecationWarning,
stacklevel=2,
)
init_params = data.get("init_parameters", {})
if key not in init_params:
raise DeserializationError(f"Missing '{key}' in serialization data")

View File

@@ -0,0 +1,5 @@
---
deprecations:
- |
``deserialize_document_store_in_init_params_inplace`` is deprecated and will be removed in Haystack version 2.24.
It is no longer used internally and should not be used in new code. The deserialization of DocumentStores is handled automatically now by default_from_dict.