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

Error of metric name use Chinese Text #3136

Closed
toop opened this issue Jul 16, 2017 · 7 comments
Closed

Error of metric name use Chinese Text #3136

toop opened this issue Jul 16, 2017 · 7 comments

Comments

@toop
Copy link
Contributor

toop commented Jul 16, 2017

Superset version

Windows 10 x64,python 3.6.1 superset 0.18.5

Expected results

metric name can use The Chinese Text

Actual results

stacktrace:null
status:"failed"
error:"'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte"
webui message:'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte

Steps to reproduce

I writed Chinese text for sql Metric name in the Sqla Table Edit‘s List Sqla Metric,when run the query,it's
error:'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte,
Request URL:http://127.0.0.1:8000/superset/explore_json/table/8/?form_data=%7B%22datasource%22%3A%228__table%22%2C%22viz_type%22%3A%22big_number_total%22%2C%22slice_id%22%3A37%2C%22granularity_sqla%22%3A%22vip15%22%2C%22time_grain_sqla%22%3A%22day%22%2C%22since%22%3A%221+year+ago%22%2C%22until%22%3A%22now%22%2C%22metric%22%3A%22%E7%A7%AF%E5%88%86%E4%BD%99%E9%A2%9D%E6%B1%87%E6%80%BB%22%2C%22y_axis_format%22%3A%22.3s%22%2C%22where%22%3A%22%22%2C%22having%22%3A%22%22%2C%22filters%22%3A%5B%5D%7D
Request Method:GET
Status Code:400 BAD REQUEST
Remote Address:127.0.0.1:8000

form_data:{"datasource":"8__table","viz_type":"big_number_total","slice_id":37,"granularity_sqla":"vip15","time_grain_sqla":"day","since":"1 year ago","until":"now","metric":"积分余额汇总","y_axis_format":".3s","where":"","having":"","filters":[]}

query:
"SELECT "积分余额汇总"↵FROM↵ (SELECT sum(vipxx.vip10) AS "积分余额汇总"↵ FROM vipxx↵ WHERE vip15 >= TO_TIMESTAMP('2016-07-16T10:01:14', 'YYYY-MM-DD"T"HH24:MI:SS.ff6')↵ AND vip15 <= TO_TIMESTAMP('2017-07-16T10:01:14', 'YYYY-MM-DD"T"HH24:MI:SS.ff6'))↵WHERE ROWNUM <= 50000"

How to fix the error,Help me please,Thk!

@xrmx
Copy link
Contributor

xrmx commented Jul 17, 2017

Please post the full stacktrace found in superset server logs, am pretty sure we already the same issue reported though.

@stjacob
Copy link

stjacob commented Jul 18, 2017

Almost the same question. I need chinese legends on my plot. So I took chinese as my metric name. WebUI shows "'ascii' codec can't encode characters in position 160-161: ordinal not in range(128)". I have set the charset on db

  1. SQLAlchemy URI
    mysql+pymysql://XXX?charset=utf8
    2.engine_params
    {
    "metadata_params": {},
    "engine_params": {"connect_args": { "charset": "utf8" }}
    }

Traceback (most recent call last):
File "/home/ad/anaconda2/lib/python2.7/site-packages/superset/viz.py", line 238, in get_payload
df = self.get_df()
File "/home/ad/anaconda2/lib/python2.7/site-packages/superset/viz.py", line 78, in get_df
self.results = self.datasource.query(query_obj)
File "/home/ad/anaconda2/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 552, in query
sql = self.get_query_str(query_obj)
File "/home/ad/anaconda2/lib/python2.7/site-packages/superset/connectors/sqla/models.py", line 326, in get_query_str
compile_kwargs={"literal_binds": True}
UnicodeEncodeError: 'ascii' codec can't encode characters in position 160-161: ordinal not in range(128)

@luciuschina
Copy link

I have the same problem,and addressed by #3136

@xrmx
Copy link
Contributor

xrmx commented Jul 25, 2017

@luciuschina #3136 is this very same bug :)

@luciuschina
Copy link

@xrmx sorry,#2554

@mistercrunch
Copy link
Member

Notice: this issue has been closed because it has been inactive for 270 days. Feel free to comment and request for this issue to be reopened.

@keeyong
Copy link

keeyong commented Jul 18, 2018

Is this problem resolved? I ran into the same problem with Korean text as a dimension name

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

6 participants