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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tiledb/dense_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def _setitem_impl(self, selection, val, nullmaps: dict):
labels = {
name: (
data
if not type(data) is np.ndarray or data.dtype is np.dtype("O")
if not isinstance(data, np.ndarray) or data.dtype == np.dtype("O")
else np.ascontiguousarray(
data, dtype=self.schema.dim_label(name).dtype
)
Expand All @@ -458,7 +458,7 @@ def _setitem_impl(self, selection, val, nullmaps: dict):

attributes.append(attr._internal_name)
# object arrays are var-len and handled later
if type(attr_val) is np.ndarray and attr_val.dtype is not np.dtype("O"):
if isinstance(attr_val, np.ndarray) and attr_val.dtype != np.dtype("O"):
if attr.isnullable and name not in nullmaps:
try:
nullmaps[name] = ~np.ma.masked_invalid(attr_val).mask
Expand Down Expand Up @@ -527,7 +527,7 @@ def _setitem_impl(self, selection, val, nullmaps: dict):
name = attr.name
attributes.append(attr._internal_name)
# object arrays are var-len and handled later
if type(val) is np.ndarray and val.dtype is not np.dtype("O"):
if isinstance(val, np.ndarray) and val.dtype != np.dtype("O"):
val = np.ascontiguousarray(val, dtype=attr.dtype)
try:
if attr.isvar:
Expand Down
2 changes: 1 addition & 1 deletion tiledb/sparse_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _setitem_impl_sparse(self, selection, val, nullmaps: dict):
labels = {
name: (
data
if not type(data) is np.ndarray or data.dtype is np.dtype("O")
if not isinstance(data, np.ndarray) or data.dtype == np.dtype("O")
else np.ascontiguousarray(data, dtype=self.schema.dim_label(name).dtype)
)
for name, data in val.items()
Expand Down
Loading