Skip to content

Commit

Permalink
Remove unecessary handling of %%
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 4, 2017
1 parent 59a6f44 commit 2d66baa
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,27 +413,6 @@ def get_sqla_query( # sqla
metrics_exprs = []

if granularity:
@compiles(ColumnClause)
def visit_column(element, compiler, **kw):
"""Patch for sqlalchemy bug
TODO: sqlalchemy 1.2 release should be doing this on its own.
Patch only if the column clause is specific for DateTime
set and granularity is selected.
"""
text = compiler.visit_column(element, **kw)
try:
if (
element.is_literal and
hasattr(element.type, 'python_type') and
type(element.type) is DateTime
):
text = text.replace('%%', '%')
except NotImplementedError:
# Some elements raise NotImplementedError for python_type
pass
return text

dttm_col = cols[granularity]
time_grain = extras.get('time_grain_sqla')

Expand Down

0 comments on commit 2d66baa

Please sign in to comment.