as_pandas failed when the resultset has 0 rows.

This also avoids needing to construct temporary dictionaries for every row, speeding up dataframe creation