Skip to content

Instantly share code, notes, and snippets.

@0xc1c4da
Created October 22, 2023 17:44
Show Gist options
  • Save 0xc1c4da/e4f383bc514520a75a8a6f74ef86392f to your computer and use it in GitHub Desktop.
Save 0xc1c4da/e4f383bc514520a75a8a6f74ef86392f to your computer and use it in GitHub Desktop.
```
doc_index = InMemoryExactNNIndex[Document](index_file_path='db_sample.bin')
pydantic/_migration.py:281: UserWarning: `pydantic.error_wrappers:ValidationError` has been moved to `pydantic:ValidationError`.
warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
Traceback (most recent call last):
File ".../test_book.py", line 27, in <module>
doc_index = InMemoryExactNNIndex[Document](index_file_path='db_nemesis_sample.bin')
File "...docarray/index/backends/in_memory.py", line 51, in __init__
super().__init__(db_config=db_config, **kwargs)
File "...docarray/index/abstract.py", line 117, in __init__
self._init_subindex()
File "...docarray/index/abstract.py", line 975, in _init_subindex
self._subindices[col_name] = self.__class__[col.docarray_type.doc_type]( # type: ignore
File "...docarray/index/backends/in_memory.py", line 68, in __init__
self._docs = DocList.__class_getitem__(
File "...docarray/array/doc_list/io.py", line 810, in load_binary
return cls._load_binary_all(
File "...docarray/array/doc_list/io.py", line 614, in _load_binary_all
return cls.from_protobuf(proto)
File "...docarray/array/doc_list/doc_list.py", line 317, in from_protobuf
return super().from_protobuf(pb_msg)
File "...docarray/array/doc_list/io.py", line 122, in from_protobuf
return cls(cls.doc_type.from_protobuf(doc_proto) for doc_proto in pb_msg.docs)
File "...docarray/array/doc_list/doc_list.py", line 135, in __init__
super().__init__(docs)
File "...docarray/array/doc_list/doc_list.py", line 162, in _validate_docs
for doc in docs:
File "...docarray/array/doc_list/io.py", line 122, in <genexpr>
return cls(cls.doc_type.from_protobuf(doc_proto) for doc_proto in pb_msg.docs)
File "...docarray/base_doc/mixins/io.py", line 258, in from_protobuf
return cls(**fields)
File "...pydantic/main.py", line 164, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 4 validation errors for _NewSchema
text
Field required [type=missing, input_value={'id': 'b4ea886d34cb4b05a9df736a9fd9099f'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.4/v/missing
text_embedding
Field required [type=missing, input_value={'id': 'b4ea886d34cb4b05a9df736a9fd9099f'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.4/v/missing
highlights
Field required [type=missing, input_value={'id': 'b4ea886d34cb4b05a9df736a9fd9099f'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.4/v/missing
highlights_embedding
Field required [type=missing, input_value={'id': 'b4ea886d34cb4b05a9df736a9fd9099f'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.4/v/missing
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment