Skip to content

Commit

Permalink
Fix generator raised StopIteration error (JohnOmernik#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbaleeta authored and jnturton committed May 29, 2024
1 parent 70bd96d commit 1609123
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sqlalchemy_drill/drilldbapi/_drilldbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@ def _report_query_state(self):
logger.warning(exception)
logger.warning(error_message)
logger.warning(stack_trace)
logger.info(query_state)
logger.error(error_message)

'''
raise DatabaseError(
f'Final Drill query state is {query_state}. {error_message}',
None
)
'''
return

def _outer_parsing_loop(self) -> bool:
'''Internal method to process the outermost query result JSON structure.
Expand Down Expand Up @@ -277,7 +282,7 @@ def fetchmany(self, size: int = None):
if self.rownumber % api_globals._PROGRESS_LOG_N == 0:
logger.info(f'streamed {self.rownumber} rows.')

except StopIteration:
except:
self.rowcount = self.rownumber
logger.info(
f'reached the end of the row data after {self.rownumber}'
Expand Down Expand Up @@ -605,4 +610,4 @@ def TimestampFromTicks(ticks):


class Binary(bytes):
"""Construct an object capable of holding a binary (long) string value."""
"""Construct an object capable of holding a binary (long) string value."""

0 comments on commit 1609123

Please sign in to comment.