Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/duckdb_py/pyconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ shared_ptr<DuckDBPyConnection> DuckDBPyConnection::ExecuteMany(const py::object

unique_ptr<QueryResult> DuckDBPyConnection::CompletePendingQuery(PendingQueryResult &pending_query) {
PendingExecutionResult execution_result;
if (pending_query.HasError()) {
pending_query.ThrowError();
}
while (!PendingQueryResult::IsResultReady(execution_result = pending_query.ExecuteTask())) {
{
py::gil_scoped_acquire gil;
Expand Down
6 changes: 3 additions & 3 deletions tests/fast/udf/test_remove_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def func(x: int) -> int:
Error: Catalog Error: Scalar Function with name func does not exist!
"""
with pytest.raises(
duckdb.InvalidInputException, match='Attempting to execute an unsuccessful or closed pending query result'
duckdb.CatalogException, match='Scalar Function with name func does not exist!'
):
res = rel.fetchall()

Expand All @@ -72,7 +72,7 @@ def also_func(x: int) -> int:
return x

con.create_function('func', also_func)
with pytest.raises(duckdb.InvalidInputException, match='No function matches the given name'):
with pytest.raises(duckdb.BinderException, match='No function matches the given name'):
res = rel2.fetchall()

def test_overwrite_name(self):
Expand All @@ -98,7 +98,7 @@ def other_func(x):
con.remove_function('func')

with pytest.raises(
duckdb.InvalidInputException, match='Catalog Error: Scalar Function with name func does not exist!'
duckdb.CatalogException, match='Catalog Error: Scalar Function with name func does not exist!'
):
# Attempted to execute the relation using the 'func' function, but it was deleted
rel1.fetchall()
Expand Down