Skip to content

Commit

Permalink
[c++] Final update for Python/R metadata typing (#2900)
Browse files Browse the repository at this point in the history
* [c++] WIP for Python/R metadata typing

* code-review feedback
  • Loading branch information
johnkerl authored Aug 16, 2024
1 parent 7241fef commit a61795a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apis/python/src/tiledbsoma/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ void set_metadata(
SOMAObject& soma_object, const std::string& key, py::array value) {
tiledb_datatype_t value_type = np_to_tdb_dtype(value.dtype());

// For https://github.com/single-cell-data/TileDB-SOMA/pull/2900:
// Ensure that all Python and R write paths use UTF-8 for string
// metadata values.
if (value_type == TILEDB_STRING_ASCII) {
value_type = TILEDB_STRING_UTF8;
}

if (is_tdb_str(value_type) && value.size() > 1)
throw py::type_error("array/list of strings not supported");

Expand Down

0 comments on commit a61795a

Please sign in to comment.