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

AttributeError when selecting timeseries #1471

Closed
petter-memrise opened this issue Oct 28, 2016 · 1 comment
Closed

AttributeError when selecting timeseries #1471

petter-memrise opened this issue Oct 28, 2016 · 1 comment

Comments

@petter-memrise
Copy link

petter-memrise commented Oct 28, 2016

Make sure these boxes are checked before submitting your issue - thank you!

  • [ x ] I have checked the caravel logs for python stacktraces and included it here as text if any
  • [ x ] I have reproduced the issue with at least the latest released version of caravel
  • [ x ] I have checked the issue tracker for the same issue and I haven't found one similar

Caravel version

0.11.0

Expected results

A line chart over time should be shown

Actual results

When executing query in the SQL editor it gives correct results, but when clicking Visualize, choosing Time Series - Line Chart, it gives the following stacktrace:

2016-10-28 12:04:51,900:INFO:root:Running query: 
SELECT * 
FROM (SELECT 
    DATE(created_on) as date, 
    metric_name metric, 
    count(1) number
FROM sql_metrics
group by 
    DATE(created_on), 
    metric_name
order by 
    DATE(created_on), 
    metric_name) AS inner_qry
 LIMIT 1000 OFFSET 0
2016-10-28 12:04:59,429:DEBUG:MARKDOWN:Successfuly imported extension module "markdown.extensions.tables".
2016-10-28 12:04:59,429:DEBUG:MARKDOWN:Successfully loaded extension "markdown.extensions.tables.TableExtension".
2016-10-28 12:04:59,430:DEBUG:MARKDOWN:Successfuly imported extension module "markdown.extensions.fenced_code".
2016-10-28 12:04:59,430:DEBUG:MARKDOWN:Successfully loaded extension "markdown.extensions.fenced_code.FencedCodeExtension".
2016-10-28 12:04:59,430:DEBUG:MARKDOWN:Successfuly imported extension module "markdown.extensions.codehilite".
2016-10-28 12:04:59,430:DEBUG:MARKDOWN:Successfully loaded extension "markdown.extensions.codehilite.CodeHiliteExtension".
2016-10-28 12:05:00,155:ERROR:root:'TextClause' object has no attribute 'join'
Traceback (most recent call last):
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/views.py", line 1183, in explore
    viz_obj.get_json(),
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/viz.py", line 318, in get_json
    'data': self.get_data(),
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/viz.py", line 1126, in get_data
    df = self.get_df()
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/viz.py", line 1028, in get_df
    df = super(NVD3TimeSeriesViz, self).get_df(query_obj)
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/viz.py", line 165, in get_df
    self.results = self.datasource.query(**query_obj)
  File "/Users/petter/.virtualenvs/caravel_test/lib/python2.7/site-packages/caravel/models.py", line 937, in query
    tbl = tbl.join(subq.alias(), and_(*on_clause))
AttributeError: 'TextClause' object has no attribute 'join'

Steps to reproduce

Run a query with one date column, one dimension and one aggregated field (grouped by date + dimension) (see test query above).

@mistercrunch
Copy link
Member

Fixed in master

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