Skip to content

Commit

Permalink
Allow discovery of non-ASCII dataframe attributes (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Dec 21, 2022
1 parent 4c67963 commit 0d04dc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tiledb/libtiledb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ cdef _write_array(tiledb_ctx_t* ctx_ptr,
try:
values[i] = np.asarray(values[i], dtype=np.bytes_)
except Exception as exc:
raise TileDBError(f'Attr\'s dtype is "ascii" but attr_val contains invalid ASCII characters')
raise TileDBError(f'dtype of attr {tiledb_array.schema.attr(i).name} is "ascii" but attr_val contains invalid ASCII characters')

attr = tiledb_array.schema.attr(i)

Expand Down Expand Up @@ -4098,7 +4098,7 @@ def _setitem_impl_sparse(self: Array, selection, val, dict nullmaps):
try:
np.asarray(attr_val, dtype=np.bytes_)
except Exception as exc:
raise TileDBError(f'Attr\'s dtype is "ascii" but attr_val contains invalid ASCII characters')
raise TileDBError(f'dtype of attr {attr.name} is "ascii" but attr_val contains invalid ASCII characters')

ncells = sparse_coords[0].shape[0]
if attr_val.size != ncells:
Expand Down

0 comments on commit 0d04dc9

Please sign in to comment.