Skip to content

Commit

Permalink
docs: add note about pickling dynamically created doc class (#1763)
Browse files Browse the repository at this point in the history
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
  • Loading branch information
JoanFM committed Aug 24, 2023
1 parent 61bf9c7 commit 587ab5b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docarray/documents/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def create_doc(
"""
Dynamically create a subclass of BaseDoc. This is a wrapper around pydantic's create_model.
!!! note
To pickle a dynamically created BaseDoc subclass:
- the class must be defined globally
- it must provide `__module__`
```python
from docarray.documents import Audio
from docarray.documents.helper import create_doc
Expand Down

0 comments on commit 587ab5b

Please sign in to comment.