Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
Build a results set of python objects.
Parameters
----------
data: QueryResultSet
Returns
-------
results: Iterator[tuple]
"""
if data.row_set.columns:
nrows = len(data.row_set.columns[0].nulls)
ncols = len(data.row_set.row_desc)
columns = [_extract_col_vals(desc, col)
for desc, col in zip(data.row_set.row_desc,
data.row_set.columns)]
for i in range(nrows):
yield tuple(columns[j][i] for j in range(ncols))