File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -459,7 +459,10 @@ struct PythonUDFData {
459459 }
460460 idx_t i = 0 ;
461461 for (auto param : params) {
462- auto type = py::cast<std::shared_ptr<DuckDBPyType>>(param);
462+ std::shared_ptr<DuckDBPyType> type;
463+ if (!DuckDBPyType::TryConvert (py::borrow<py::object>(param), type)) {
464+ throw InvalidInputException (" Could not convert a provided parameter to a DuckDBPyType" );
465+ }
463466 parameters[i++] = type->Type ();
464467 }
465468 }
@@ -489,7 +492,10 @@ struct PythonUDFData {
489492 }
490493 param_count = py::len (sig_params);
491494 parameters.reserve (param_count);
492- auto params = py::cast<py::dict>(sig_params);
495+ // inspect.Signature.parameters is a mappingproxy, not a dict; materialize a real dict (nanobind's
496+ // cast<py::dict> would reject the proxy, unlike pybind11's converting py::dict).
497+ py::dict params;
498+ params.update (sig_params);
493499 for (auto item : params) {
494500 auto value = item.second ;
495501 std::shared_ptr<DuckDBPyType> pytype;
You can’t perform that action at this time.
0 commit comments