FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

replace usage of `issubclass` with `safe_issubclass` in `BaseDocWitho… by yxtay · Pull Request #1904 · docarray/docarray · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion docarray/base_doc/doc.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _exclude_doclist(
from docarray.array.any_array import AnyDocArray

type_ = self._get_field_annotation(field)
if isinstance(type_, type) and issubclass(type_, AnyDocArray):
if isinstance(type_, type) and safe_issubclass(type_, AnyDocArray):
doclist_exclude_fields.append(field)

original_exclude = exclude
Expand Down
4 changes: 2 additions & 2 deletions docarray/index/backends/milvus.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def python_type_to_db_type(self, python_type: Type) -> Any:
AbstractTensor: DataType.FLOAT_VECTOR,
}

if issubclass(python_type, ID):
if safe_issubclass(python_type, ID):
return DataType.VARCHAR

for py_type, db_type in type_map.items():
Expand Down Expand Up @@ -665,7 +665,7 @@ def find_batched(
if search_field:
if '__' in search_field:
fields = search_field.split('__')
if issubclass(self._schema._get_field_annotation(fields[0]), AnyDocArray): # type: ignore
if safe_issubclass(self._schema._get_field_annotation(fields[0]), AnyDocArray): # type: ignore
return self._subindices[fields[0]].find_batched(
queries,
search_field='__'.join(fields[1:]),
Expand Down

Back | FazBrowse Home | New Git URL