Skip to content

Commit 1e78339

Browse files
committed
detect the error and throw before trying to execute, removing the 'Attempting to execute and unsuccesful or closed pending query result'
1 parent ef2cd8b commit 1e78339

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/duckdb_py/pyconnection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ shared_ptr<DuckDBPyConnection> DuckDBPyConnection::ExecuteMany(const py::object
465465

466466
unique_ptr<QueryResult> DuckDBPyConnection::CompletePendingQuery(PendingQueryResult &pending_query) {
467467
PendingExecutionResult execution_result;
468+
if (pending_query.HasError()) {
469+
pending_query.ThrowError();
470+
}
468471
while (!PendingQueryResult::IsResultReady(execution_result = pending_query.ExecuteTask())) {
469472
{
470473
py::gil_scoped_acquire gil;

0 commit comments

Comments
 (0)