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

UnicodeEncodeError #235

Closed
isublimity opened this issue Apr 1, 2016 · 3 comments
Closed

UnicodeEncodeError #235

isublimity opened this issue Apr 1, 2016 · 3 comments

Comments

@isublimity
Copy link

Find some bug, if i create "Time Series - Line Chart" and use "Group by" - field containing Russian utf-8 chars i get error "UnicodeEncodeError", but if create simple "pivot table" all OK.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/caravel-0.8.4-py2.7.egg/caravel/models.py", line 1110, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/caravel-0.8.4-py2.7.egg/caravel/views.py", line 450, in explore
    raise e
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Screens : http://take.ms/xFrTJ http://take.ms/zUzrj

Sorry my eng)

@mistercrunch
Copy link
Member

Oh no! Unicode errors... Until we iron that out, can you try on python3 by any chance?

@isublimity
Copy link
Author

I found the solution to my problem, file
https://github.com/airbnb/caravel/blob/master/caravel/viz.py#L702
name = ["{}".format(s) for s in name]
Replace with
name = ["{}".format(s.encode('utf-8')) for s in name]

The first time I have been programming in Python, can greatly mistaken;)

@mistercrunch
Copy link
Member

I think this is fixed now with the from __future__ import unicode_literals I sprinkled on all files

graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this issue Oct 4, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
Bumps [@vx/legend](https://github.com/hshoff/vx) from 0.0.190 to 0.0.192.
- [Release notes](https://github.com/hshoff/vx/releases)
- [Changelog](https://github.com/hshoff/vx/blob/master/CHANGELOG.md)
- [Commits](airbnb/visx@v0.0.190...v0.0.192)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
Bumps [@vx/legend](https://github.com/hshoff/vx) from 0.0.190 to 0.0.192.
- [Release notes](https://github.com/hshoff/vx/releases)
- [Changelog](https://github.com/hshoff/vx/blob/master/CHANGELOG.md)
- [Commits](airbnb/visx@v0.0.190...v0.0.192)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
Bumps [@vx/legend](https://github.com/hshoff/vx) from 0.0.190 to 0.0.192.
- [Release notes](https://github.com/hshoff/vx/releases)
- [Changelog](https://github.com/hshoff/vx/blob/master/CHANGELOG.md)
- [Commits](airbnb/visx@v0.0.190...v0.0.192)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Bumps [@vx/legend](https://github.com/hshoff/vx) from 0.0.190 to 0.0.192.
- [Release notes](https://github.com/hshoff/vx/releases)
- [Changelog](https://github.com/hshoff/vx/blob/master/CHANGELOG.md)
- [Commits](airbnb/visx@v0.0.190...v0.0.192)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
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

2 participants