mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-12 23:37:36 +00:00
This reverts commit d234c75168dcb49866a6714aa232f37d56f72cab.
This commit is contained in:
parent
d234c75168
commit
d6f073f9b3
@ -108,8 +108,6 @@ class PyPDFToDocument:
|
||||
:returns:
|
||||
Deserialized component.
|
||||
"""
|
||||
# the converter default is `None`, check if it was defined before deserializing
|
||||
if "converter" in data["init_parameters"]:
|
||||
converter_class = deserialize_type(data["init_parameters"]["converter"]["type"])
|
||||
data["init_parameters"]["converter"] = converter_class.from_dict(data["init_parameters"]["converter"])
|
||||
return default_from_dict(cls, data)
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Make the `from_dict` method of the `PyPDFToDocument` more robust to cases when the converter is
|
||||
not provided in the dictionary.
|
||||
@ -40,12 +40,6 @@ class TestPyPDFToDocument:
|
||||
assert isinstance(instance, PyPDFToDocument)
|
||||
assert isinstance(instance.converter, DefaultConverter)
|
||||
|
||||
def test_from_dict_no_converter(self):
|
||||
data = {"type": "haystack.components.converters.pypdf.PyPDFToDocument", "init_parameters": {}}
|
||||
instance = PyPDFToDocument.from_dict(data)
|
||||
assert isinstance(instance, PyPDFToDocument)
|
||||
assert isinstance(instance.converter, DefaultConverter)
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_run(self, test_files_path, pypdf_converter):
|
||||
"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user