Closed jiejieling closed 1 year ago
Thanks!
Sorry I'm late, but we should still return an error if the columns do not match. The empty dict and list should only be returned if the columns match but no rows are found, as mentioned in https://github.com/long2ice/asynch/issues/64. Example:
async def fetchmany(self, size: int):
rows = await super(DictCursor, self).fetchmany(size)
if self._columns:
return [dict(zip(self._columns, item)) for item in rows] if rows else []
else:
raise AttributeError("Not found valid columns")
The error message provides useful debugging information about why it is failing.
return {}/[] to instead of raising AttributeError when use dictCursor and result is empty