Incubator-superset: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

Created on 27 Feb 2017  ·  7Comments  ·  Source: apache/incubator-superset

superset==0.15.4

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

image

Most helpful comment

@asdf2014 I changed to python3. If python2, try to add # -*- coding: utf-8 -*- in the first line of x.py

All 7 comments

it would help to have info about your backend and python version

@mistercrunch If use mysql as backend, should create database db character set utf8 and add charset=utf8 in sqlalchemy_url.

But use the sqlalchemy_url not containing charset=utf8 to connect mysql once (of course failed), then use the right sqlalchemy_url with charset=utf8, occurs the same error, need to re-create the database and re-generate superset's metadata.

Does the sqlalchemy_url without charset=utf8 modify some properties of db? But the info of db showed by status don't have changed.

@zhangjiajie023 @mistercrunch I meet the same situation again when i upgrade superset from v0.15.4 into v0.17.0 using mysql as a metadata store.

superset db upgrade
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 1296d28ec131 -> f18570e03440, Add index on the result key to the query table.
INFO  [alembic.runtime.migration] Running upgrade f18570e03440 -> bcf3126872fc, Add keyvalue table
INFO  [alembic.runtime.migration] Running upgrade f18570e03440 -> db0c65b146bd, update_slice_model_json
最近一小时 Write OPS error: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
// ...

I think this could be the reason...

image

@asdf2014 I changed to python3. If python2, try to add # -*- coding: utf-8 -*- in the first line of x.py

@zhangjiajie023 You mean like this?

image

You are so great! Thx a lot.
image

Was this page helpful?
0 / 5 - 0 ratings