-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Description
Context
from docarray import DocList, BaseDoc
docs = DocList[BaseDoc()]# 1
class MyDoc(BaseDoc):
text: str
DocList[MyDoc][MyDoc] # 2
Both 1 and 2 lines should failed with a nice error message
description
DocList[X] should only accept BaseDoc class and should not be called twice
How to do it
This should be as easy as adding if else statement and raise properly error in this part of the codebase:
docarray/docarray/array/any_array.py
Line 56 in 715252a
if not safe_issubclass(item, BaseDoc): |
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo/Bug