Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when exporting CSV #38

Closed
mmxmb opened this issue Feb 21, 2018 · 2 comments
Closed

Error when exporting CSV #38

mmxmb opened this issue Feb 21, 2018 · 2 comments

Comments

@mmxmb
Copy link

mmxmb commented Feb 21, 2018

Error

When trying to export table as JSON or CSV using the corresponding buttons in the Query section of the web interface I get the following error message:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Traceback

[2018-02-21 01:21:04,466] ERROR in app: Exception on /EOS_BTC_binance/query/ [POST]
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py", line 185, in inner
    return fn(table, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py", line 452, in table_query
    return export(table, sql, 'csv')
  File "/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py", line 506, in export
    dataset.freeze(query, export_format, file_obj=buf, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/playhouse/dataset.py", line 131, in freeze
    exporter.export(file_obj, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/playhouse/dataset.py", line 301, in export
    for row in self.query.tuples():
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 1533, in __iter__
    self._ensure_execution()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 1530, in _ensure_execution
    self.execute()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 1447, in inner
    return method(self, database, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 1518, in execute
    return self._execute(database)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 1571, in _execute
    self._cursor_wrapper = self._get_cursor_wrapper(cursor)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py", line 5409, in _get_cursor_wrapper
    return ModelTupleCursorWrapper(cursor, self.model, self._returning)
AttributeError: 'ModelRaw' object has no attribute '_returning'
64.229.97.140 - - [21/Feb/2018 01:21:04] "POST /EOS_BTC_binance/query/ HTTP/1.1" 500 -

System Info

Ubuntu 16.04
Python 3.5.2
sqlite-web (0.2.0)

@coleifer
Copy link
Owner

Fixed with Peewee commit: coleifer/peewee@c3c3cf5

Will push a new release of Peewee to PyPI so you can get the change. Thanks for reporting.

@coleifer
Copy link
Owner

Peewee 3.0.19 released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants