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:
|
if not safe_issubclass(item, BaseDoc): |
Context
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