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

refactor: use safe_issubclass by JoanFM · Pull Request #1778 · 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/array/doc_vec/doc_vec.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 @@ -214,7 +214,7 @@ def _check_doc_field_not_none(field_name, doc):

stacked: tf.Tensor = tf.stack(tf_stack)
tensor_columns[field_name] = TensorFlowTensor(stacked)
elif jnp_available and issubclass(field_type, JaxArray):
elif jnp_available and safe_issubclass(field_type, JaxArray):
if first_doc_is_none:
_verify_optional_field_of_docs(docs)
tensor_columns[field_name] = None
Expand Down
2 changes: 1 addition & 1 deletion docarray/typing/tensor/abstract_tensor.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 @@ -95,7 +95,7 @@ def __instancecheck__(cls, instance):
for candidate in type(instance).__mro__
)
return any(
issubclass(candidate, cls) for candidate in type(instance).__mro__
safe_issubclass(candidate, cls) for candidate in type(instance).__mro__
)
return super().__instancecheck__(instance)

Expand Down

Back | FazBrowse Home | New Git URL