Skip to content

Error when using a Google Spreadsheet that includes a pivot table #297

@alykat

Description

@alykat

Newish-to-me bug:

I created a pivot table in an existing graphic (trump-twitter-endorsements-senate-20181107) to verify some category counts. When I went back to the graphic, I got the following error:

Traceback (most recent call last):
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/ahurt/src/dailygraphics/oauth.py", line 86, in decorated_function
    return f(*args, **kwargs)
  File "/Users/ahurt/src/dailygraphics/graphic.py", line 56, in _graphics_detail
    context['COPY'] = copytext.Copy(filename=copy_path)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/copytext.py", line 187, in __init__
    self.load()
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/copytext.py", line 203, in load
    book = load_workbook(self._filename, data_only=True)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/reader/excel.py", line 224, in load_workbook
    pivot_caches = parser.pivot_caches
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/packaging/workbook.py", line 125, in pivot_caches
    cache = get_rel(self.archive, self.rels, id=c.id, cls=CacheDefinition)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/packaging/relationship.py", line 162, in get_rel
    obj.deps = get_dependents(archive, rels_path)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/packaging/relationship.py", line 130, in get_dependents
    rels = RelationshipList.from_tree(node)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/descriptors/serialisable.py", line 84, in from_tree
    obj = desc.expected_type.from_tree(el)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/descriptors/serialisable.py", line 100, in from_tree
    return cls(**attrib)
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/packaging/relationship.py", line 50, in __init__
    self.Target = Target
  File "/Users/ahurt/.virtualenvs/dailygraphics/lib/python2.7/site-packages/openpyxl/descriptors/base.py", line 44, in __set__
    raise TypeError('expected ' + str(self.expected_type))
TypeError: expected <type 'basestring'>

Deleting the pivot table fixed the issue (but isn't great as a long-term solution).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions