diff --git a/apis/python/src/tiledbsoma/reindexer.cc b/apis/python/src/tiledbsoma/reindexer.cc index 0df805151a..4d2c5277c0 100644 --- a/apis/python/src/tiledbsoma/reindexer.cc +++ b/apis/python/src/tiledbsoma/reindexer.cc @@ -64,11 +64,13 @@ py::array_t get_indexer_general_aux( } py::array_t get_indexer_general( IntIndexer& indexer, py::array_t lookups) { - if (lookups.ndim() != 1) + if (lookups.ndim() != 1) { throw std::invalid_argument( "IntIndexer only supports arrays of dimension 1"); - if (lookups.dtype() != py::dtype::of()) + } + if (!lookups.dtype().is(py::dtype::of())) { throw py::type_error("IntIndexer only supports array of type int64"); + } try { return get_indexer_general_aux(indexer, lookups); @@ -182,12 +184,14 @@ void load_reindexer(py::module& m) { .def( "map_locations", [](IntIndexer& indexer, py::array keys) { - if (keys.ndim() != 1) + if (keys.ndim() != 1) { throw std::invalid_argument( "IntIndexer only supports arrays of dimension 1"); - if (keys.dtype() != py::dtype::of()) + } + if (!keys.dtype().is(py::dtype::of())) { throw py::type_error( "IntIndexer only supports array of type int64"); + } auto keys_int64 = py::cast>(keys); try { diff --git a/apis/python/src/tiledbsoma/soma_object.cc b/apis/python/src/tiledbsoma/soma_object.cc index 4f05073ba7..b974e9cdd6 100644 --- a/apis/python/src/tiledbsoma/soma_object.cc +++ b/apis/python/src/tiledbsoma/soma_object.cc @@ -113,6 +113,9 @@ void load_soma_object(py::module& m) { "already handled. This indicates a logic error or an " "unexpected failure to catch exceptions by " "SOMAObject::open"); + + return py::none(); // Unreached, but appeases a compiler + // warning }, "uri"_a, "mode"_a,