Issue 1:
version:0.19.1

if I set the series limit to 100 -> query works

SELECT tenant AS tenant,

ymd_ts AS timestamp,

SUM(myschema.marathonreservation.weightedtotal) AS sum__weightedtotal

FROM myschema.marathonreservation

JOIN

(SELECT tenant AS tenant,

SUM(myschema.marathonreservation.weightedtotal) AS mme_inner__

FROM myschema.marathonreservation

WHERE ymd_ts >= '1917-09-14 00:00:00'

AND ymd_ts <= '2017-09-14 14:21:08'

GROUP BY tenant

ORDER BY mme_inner__ DESC

LIMIT 100) AS anon_1 ON tenant = tenant__

WHERE ymd_ts >= '1917-09-14 00:00:00'

AND ymd_ts <= '2017-09-14 14:21:08'

GROUP BY tenant,

ymd_ts

ORDER BY sum__weightedtotal DESC

LIMIT 5000

if I remove the series limit (by putting on 0) -> '>' not supported between instances of 'str' and 'int'

SELECT tenant AS tenant,

ymd_ts AS __timestamp,

SUM(myschema.marathonreservation.weightedtotal) AS sum__weightedtotal

FROM myschema.marathonreservation

WHERE ymd_ts >= '1917-09-14 00:00:00'

AND ymd_ts <= '2017-09-14 14:21:35'

GROUP BY tenant,

ymd_ts

ORDER BY sum__weightedtotal DESC

LIMIT 5000

Traceback (most recent call last):

File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 251, in get_payload

data = self.get_data(df)

File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 916, in get_data

df = self.process_data(df)

File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 865, in process_data

values=fd.get('metrics'))

File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/pivot.py", line 160, in pivot_table

table = table.sort_index(axis=1)

File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 3243, in sort_index

labels = labels._sort_levels_monotonic()

File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/multi.py", line 1240, in _sort_levels_monotonic

indexer = lev.argsort()

File "/usr/local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2091, in argsort

return result.argsort(*args, **kwargs)

TypeError: '>' not supported between instances of 'str' and 'int'

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

I have checked the superset logs for python stacktraces and included it here as text if any

I have reproduced the issue with at least the latest released version of superset

I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.18.5

Expected results

the slice loads fine, as it did in caravel 0.14.X

Actual results

2017-06-23 15:36:22,271:ERROR:root:unorderable types: str() > int()
Traceback (most recent call last):
File "/venv/lib/python3.4/site-packages/superset/viz.py", line 240, in get_payload
data = self.get_data(df)
File "/venv/lib/python3.4/site-packages/superset/viz.py", line 1095, in get_data
values=self.metrics)
File "/venv/lib/python3.4/site-packages/pandas/core/reshape/pivot.py", line 160, in pivot_table
table = table.sort_index(axis=1)
File "/venv/lib/python3.4/site-packages/pandas/core/frame.py", line 3243, in sort_index
labels = labels._sort_levels_monotonic()
File "/venv/lib/python3.4/site-packages/pandas/core/indexes/multi.py", line 1240, in _sort_levels_monotonic
indexer = lev.argsort()
File "/venv/lib/python3.4/site-packages/pandas/core/indexes/base.py", line 2091, in argsort
return result.argsort(*args, **kwargs)
TypeError: unorderable types: str() > int()

Steps to reproduce

open the slice

It happens on a specific slice that i cannot share unfortunately. Note to self: this is "distribuzione uso complessivo per scuola"