We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a4a4208 + 1964ad5 commit 108e472Copy full SHA for 108e472
1 file changed
src/duckdb_py/pyresult.cpp
@@ -117,16 +117,13 @@ unique_ptr<DataChunk> DuckDBPyResult::FetchNextRaw(QueryResult &query_result) {
117
}
118
119
Optional<py::tuple> DuckDBPyResult::Fetchone() {
120
- {
121
- D_ASSERT(py::gil_check());
+ if (!result) {
+ throw InvalidInputException("result closed");
122
+ }
123
+ if (!current_chunk || chunk_offset >= current_chunk->size()) {
124
py::gil_scoped_release release;
- if (!result) {
- throw InvalidInputException("result closed");
125
- }
126
- if (!current_chunk || chunk_offset >= current_chunk->size()) {
127
- current_chunk = FetchNext(*result);
128
- chunk_offset = 0;
129
+ current_chunk = FetchNext(*result);
+ chunk_offset = 0;
130
131
132
if (!current_chunk || current_chunk->size() == 0) {
0 commit comments