We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82c6ebf commit 06bb706Copy full SHA for 06bb706
1 file changed
src/duckdb_py/python_udf.cpp
@@ -523,7 +523,10 @@ struct PythonUDFData {
523
if (!numpy) {
524
throw InvalidInputException("'numpy' is required for this operation, but it wasn't installed");
525
}
526
- auto numpy_version = py::cast<py::tuple>(numpy.attr("__version__"));
+ // numpy.__version__ is a string; pybind11's cast<py::tuple> converted it to a tuple of characters
527
+ // (PySequence_Tuple). nanobind's cast<py::tuple> would reject a non-tuple, so convert explicitly.
528
+ py::object numpy_version_str = numpy.attr("__version__");
529
+ auto numpy_version = py::tuple(numpy_version_str);
530
if (NumpyDeprecatesAccessToCore(numpy_version)) {
531
core = numpy.attr("_core");
532
} else {
0 commit comments