GithubHelp home page GithubHelp logo

Comments (8)

sid88in avatar sid88in commented on May 5, 2024

+1

from superset.

sid88in avatar sid88in commented on May 5, 2024

"GET /caravel/explore/druid/2/?viz_type=table&granularity=one+day&since=7+days+ago&until=1+day+ago&row_limit=5000&include_search=false&metrics=count&flt_col_0=country_woeid&flt_op_0=in&flt_eq_0=&slice_id=&slice_name=&collapsed_fieldsets=&action=&datasource_name=fact_supply_xd&datasource_id=2&datasource_type=druid&previous_viz_type=table&json=true&force=true HTTP/1.1" 500 -

from superset.

sid88in avatar sid88in commented on May 5, 2024

Ok found the fix but still trying to figure out the issue
the fix is this - when you refresh metadata, the data source you are querying against needs to have cache timeout in the settings in the UI.
If the field is left blank - then we get an error : i.e AttributeError: 'DruidDatasource' object has no attribute 'database'
I even included the field in caravel_config.py like CACHE_DEFAULT_TIMEOUT=6000 but that didn't help either. The UI needs to have that field otherwise we get an exception here:
https://github.com/airbnb/caravel/blob/master/caravel/viz.py#L225
the code goes into this if else condition (when the field is left blank): https://github.com/airbnb/caravel/blob/master/caravel/viz.py#L235

from superset.

sid88in avatar sid88in commented on May 5, 2024

@mistercrunch I fixed the issue. I will send the PR asap

from superset.

sid88in avatar sid88in commented on May 5, 2024

#210

from superset.

sid88in avatar sid88in commented on May 5, 2024

Stack Trace:

Traceback (most recent call last):
File "/home/y/lib/python2.7/site-packages/caravel/views.py", line 446, in explore
payload = obj.get_json()
File "/home/y/lib/python2.7/site-packages/caravel/viz.py", line 270, in get_json
cache.set(cache_key, payload, timeout=self.cache_timeout)
File "/home/y/lib/python2.7/site-packages/caravel/viz.py", line 223, in cache_timeout
self.datasource.database.cache_timeout or
AttributeError: 'DruidDatasource' object has no attribute 'database'
2016-03-29 20:42:21,432:INFO:werkzeug:66.228.162.48 - - [29/Mar/2016 20:42:21] "GET /caravel/explore/druid/2/?viz_type=table&granularity=one+day&since=7+days+ago&until=now&row_limit=5000&include_search=false&metrics=count&flt_col_0=country_woeid&flt_op_0=in&flt_eq_0=&slice_id=&slice_name=&collapsed_fieldsets=&action=&datasource_name=fact_supply_xd&datasource_id=2&datasource_type=druid&previous_viz_type=table&json=true&force=true HTTP/1.1" 500 -
Traceback (most recent call last):
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/y/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/y/lib/python2.7/site-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
return f(self, _args, *_kwargs)
File "/home/y/lib/python2.7/site-packages/caravel/models.py", line 1113, in wrapper
return f(_args, *_kwargs)
File "/home/y/lib/python2.7/site-packages/caravel/views.py", line 451, in explore
raise e
AttributeError: 'DruidDatasource' object has no attribute 'database'

from superset.

sid88in avatar sid88in commented on May 5, 2024

obj.get_json() throws an exception if cache timeout is not specified in the UI

from superset.

mistercrunch avatar mistercrunch commented on May 5, 2024

This is now fixed in master please confirm

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.