-
-
Notifications
You must be signed in to change notification settings - Fork 167
Creating new book results in TypeError #97
Copy link
Copy link
Closed
Description
I'm having trouble trying to build a book:
toc = {'Video': pe.get_sheet(records=video_results),
'Collection': pe.get_sheet(records=collection_results),
'Notes': pe.get_sheet(records=notes_results),
'User': pe.get_sheet(records=user_results)}
backup = pe.Book(toc)
Results in an TypeError:
Traceback (most recent call last):
File "./datatool.py", line 454, in <module>
generate_backup(filename=filename, project=project)
File "./datatool.py", line 198, in generate_backup
backup = pe.Book(toc)
File "/usr/local/lib/python2.7/site-packages/pyexcel/book.py", line 40, in __init__
self.init(sheets=sheets, filename=filename, path=path)
File "/usr/local/lib/python2.7/site-packages/pyexcel/book.py", line 47, in init
self.load_from_sheets(sheets)
File "/usr/local/lib/python2.7/site-packages/pyexcel/book.py", line 64, in load_from_sheets
sheet = Sheet(sheets[name], name)
File "/usr/local/lib/python2.7/site-packages/pyexcel/sheet.py", line 87, in __init__
transpose_after=transpose_after
File "/usr/local/lib/python2.7/site-packages/pyexcel/sheet.py", line 130, in init
Matrix.__init__(self, sheet)
File "/usr/local/lib/python2.7/site-packages/pyexcel/internal/sheets/matrix.py", line 41, in __init__
self.__width, self.__array = uniform(array)
File "/usr/local/lib/python2.7/site-packages/pyexcel/internal/sheets/matrix.py", line 805, in uniform
width = longest_row_number(array)
File "/usr/local/lib/python2.7/site-packages/pyexcel/internal/sheets/matrix.py", line 793, in longest_row_number
if len(array) > 0:
TypeError: object of type 'Sheet' has no len()
This is only happening when trying to build a book; running save_as on the individual get_sheet objects work fine and generate the expected output.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels