Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Apr 26, 2024
1 parent 9bf6a33 commit 851b98f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions posthog/clickhouse/client/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _prepare_query(

if "--" in rendered_sql or "/*" in rendered_sql:
# This can take a very long time with e.g. large funnel queries
formatted_sql = sqlparse.format(rendered_sql, reindent_aligned=True)
formatted_sql = sqlparse.format(rendered_sql, strip_comments=True)
else:
formatted_sql = rendered_sql
annotated_sql, tags = _annotate_tagged_query(formatted_sql, workload)
Expand All @@ -231,11 +231,7 @@ def _annotate_tagged_query(query, workload):


def format_sql(rendered_sql, colorize=True):
if "--" in rendered_sql or "/*" in rendered_sql:
# This can take a very long time with e.g. large funnel queries
formatted_sql = sqlparse.format(rendered_sql, reindent_aligned=True)
else:
formatted_sql = rendered_sql
formatted_sql = sqlparse.format(rendered_sql, reindent_aligned=True)
if colorize:
try:
import pygments.formatters
Expand Down

0 comments on commit 851b98f

Please sign in to comment.