@@ -133,7 +133,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::ProjectFromTypes(const py::object
133133 auto *type_p = item.cast <DuckDBPyType *>();
134134 type = type_p->Type ();
135135 } else {
136- string actual_type = py::str (item. get_type ( ));
136+ string actual_type = py::str (py::type::of (item ));
137137 throw InvalidInputException (" Can only project on objects of type DuckDBPyType or str, not '%s'" ,
138138 actual_type);
139139 }
@@ -218,7 +218,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::Sort(const py::args &args) {
218218 for (auto arg : args) {
219219 shared_ptr<DuckDBPyExpression> py_expr;
220220 if (!py::try_cast<shared_ptr<DuckDBPyExpression>>(arg, py_expr)) {
221- string actual_type = py::str (arg. get_type ( ));
221+ string actual_type = py::str (py::type::of (arg ));
222222 throw InvalidInputException (" Expected argument of type Expression, received '%s' instead" , actual_type);
223223 }
224224 auto expr = py_expr->GetExpression ().Copy ();
@@ -247,7 +247,7 @@ vector<unique_ptr<ParsedExpression>> GetExpressions(ClientContext &context, cons
247247 auto aggregate_list = std::string (py::str (expr));
248248 return Parser::ParseExpressionList (aggregate_list, context.GetParserOptions ());
249249 } else {
250- string actual_type = py::str (expr. get_type ( ));
250+ string actual_type = py::str (py::type::of (expr ));
251251 throw InvalidInputException (" Please provide either a string or list of Expression objects, not %s" ,
252252 actual_type);
253253 }
@@ -1182,7 +1182,7 @@ unique_ptr<DuckDBPyRelation> DuckDBPyRelation::Join(DuckDBPyRelation *other, con
11821182 auto using_list_p = py::list (condition);
11831183 for (auto &item : using_list_p) {
11841184 if (!py::isinstance<py::str>(item)) {
1185- string actual_type = py::str (item. get_type ( ));
1185+ string actual_type = py::str (py::type::of (item ));
11861186 throw InvalidInputException (" Using clause should be a list of strings, not %s" , actual_type);
11871187 }
11881188 using_list.push_back (std::string (py::str (item)));
@@ -1593,7 +1593,7 @@ void DuckDBPyRelation::Update(const py::object &set_p, const py::object &where)
15931593 }
15941594 shared_ptr<DuckDBPyExpression> py_expr;
15951595 if (!py::try_cast<shared_ptr<DuckDBPyExpression>>(item_value, py_expr)) {
1596- string actual_type = py::str (item_value. get_type ( ));
1596+ string actual_type = py::str (py::type::of (item_value ));
15971597 throw InvalidInputException (" Please provide an object of type Expression as the value, not %s" ,
15981598 actual_type);
15991599 }
0 commit comments