added check for if zero rows are returned by query

This commit is contained in:
Varun Agrawal
2016-04-12 20:36:34 -04:00
parent 52351e8ff4
commit 98ac44d450
+5
View File
@@ -165,6 +165,11 @@ class RecordCollection(object):
# Create a new Tablib Dataset.
data = tablib.Dataset()
# If the RecordCollection is empty, just return the empty set
# Check number of rows by typecasting to list
if len(list(self)) == 0:
return data
# Set the column names as headers on Tablib Dataset.
first = self[0]