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

TypeError: <pydruid.utils.filters.Filter instance at 0x7f38cc1bbb48> is not JSON serializable #388

Closed
x4base opened this issue Apr 21, 2016 · 1 comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@x4base
Copy link
Contributor

x4base commented Apr 21, 2016

It seems that this line in #387 causes a new bug
File "/projects/druid/panoramix/caravel/models.py", line 1116, in query
query_str += json.dumps(qry, indent=2)

because qry['filter'] is a Filter instance

Stack:
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
Open an interactive python shell in this framereraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python2.7/site-packages/Flask_AppBuilder-1.6.0-py2.7.egg/flask_appbuilder/security/decorators.py", line 26, in wraps
return f(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/caravel-0.8.8-py2.7.egg/caravel/models.py", line 1176, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/caravel-0.8.8-py2.7.egg/caravel/views.py", line 514, in explore
raise e

Traceback (most recent call last):
  File "/projects/druid/panoramix/caravel/views.py", line 510, in explore
    payload = obj.get_json()
  File "/projects/druid/panoramix/caravel/viz.py", line 251, in get_json
    'data': self.get_data(),
  File "/projects/druid/panoramix/caravel/viz.py", line 745, in get_data
    df = self.get_df()
  File "/projects/druid/panoramix/caravel/viz.py", line 140, in get_df
    self.results = self.datasource.query(**query_obj)
  File "/projects/druid/panoramix/caravel/models.py", line 1116, in query
    query_str += json.dumps(qry, indent=2)
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/encoder.py", line 209, in encode
    chunks = list(chunks)
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/encoder.py", line 434, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
    for chunk in chunks:
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/encoder.py", line 442, in _iterencode
    o = _default(o)
  File "/Users/clu/.pyenv/versions/2.7.5/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <pydruid.utils.filters.Filter instance at 0x10ae1d128> is not JSON serializable
@mistercrunch mistercrunch added the !deprecated-label:bug Deprecated label - Use #bug instead label Apr 22, 2016
mistercrunch referenced this issue in mistercrunch/superset Apr 22, 2016
@mistercrunch
Copy link
Member

#391

mistercrunch added a commit that referenced this issue Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

No branches or pull requests

2 participants