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

[sql lab] fix encoding error in logging message #3424

Merged
merged 1 commit into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions superset/sql_lab.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import unicode_literals

from time import sleep
from datetime import datetime
import json
Expand Down Expand Up @@ -34,8 +36,8 @@ def dedup(l, suffix='__'):
Always returns the same number of entries as provided, and always returns
unique values.

>>> dedup(['foo', 'bar', 'bar', 'bar'])
['foo', 'bar', 'bar__1', 'bar__2']
>>> print(','.join(dedup(['foo', 'bar', 'bar', 'bar'])))
foo,bar,bar__1,bar__2
"""
new_l = []
seen = {}
Expand Down
2 changes: 2 additions & 0 deletions superset/sql_parse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import unicode_literals

import logging

import sqlparse
Expand Down
5 changes: 5 additions & 0 deletions tests/sql_parse_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down Expand Up @@ -27,6 +28,10 @@ def test_simple_select(self):
query = 'SELECT * FROM "tbname"'
self.assertEquals({"tbname"}, self.extract_tables(query))

# unicode encoding
query = 'SELECT * FROM "tb_name" WHERE city = "Lübeck"'
self.assertEquals({"tb_name"}, self.extract_tables(query))

# schema
self.assertEquals(
{"schemaname.tbname"},
Expand Down