@@ -134,7 +134,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::ProjectFromTypes(const py::object
134134 auto *type_p = item.cast <DuckDBPyType *>();
135135 type = type_p->Type ();
136136 } else {
137- string actual_type = py::str (item. get_type ( ));
137+ string actual_type = py::str (py::type::of (item ));
138138 throw InvalidInputException (" Can only project on objects of type DuckDBPyType or str, not '%s'" ,
139139 actual_type);
140140 }
@@ -219,7 +219,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::Sort(const py::args &args) {
219219 for (auto arg : args) {
220220 shared_ptr<DuckDBPyExpression> py_expr;
221221 if (!py::try_cast<shared_ptr<DuckDBPyExpression>>(arg, py_expr)) {
222- string actual_type = py::str (arg. get_type ( ));
222+ string actual_type = py::str (py::type::of (arg ));
223223 throw InvalidInputException (" Expected argument of type Expression, received '%s' instead" , actual_type);
224224 }
225225 auto expr = py_expr->GetExpression ().Copy ();
@@ -248,7 +248,7 @@ vector<unique_ptr<ParsedExpression>> GetExpressions(ClientContext &context, cons
248248 auto aggregate_list = std::string (py::str (expr));
249249 return Parser::ParseExpressionList (aggregate_list, context.GetParserOptions ());
250250 } else {
251- string actual_type = py::str (expr. get_type ( ));
251+ string actual_type = py::str (py::type::of (expr ));
252252 throw InvalidInputException (" Please provide either a string or list of Expression objects, not %s" ,
253253 actual_type);
254254 }
@@ -1183,7 +1183,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::Join(DuckDBPyRelation *other, con
11831183 auto using_list_p = py::list (condition);
11841184 for (auto &item : using_list_p) {
11851185 if (!py::isinstance<py::str>(item)) {
1186- string actual_type = py::str (item. get_type ( ));
1186+ string actual_type = py::str (py::type::of (item ));
11871187 throw InvalidInputException (" Using clause should be a list of strings, not %s" , actual_type);
11881188 }
11891189 using_list.push_back (std::string (py::str (item)));
@@ -1594,7 +1594,7 @@ void DuckDBPyRelation::Update(const py::object &set_p, const py::object &where)
15941594 }
15951595 shared_ptr<DuckDBPyExpression> py_expr;
15961596 if (!py::try_cast<shared_ptr<DuckDBPyExpression>>(item_value, py_expr)) {
1597- string actual_type = py::str (item_value. get_type ( ));
1597+ string actual_type = py::str (py::type::of (item_value ));
15981598 throw InvalidInputException (" Please provide an object of type Expression as the value, not %s" ,
15991599 actual_type);
16001600 }
0 commit comments