{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/caravel/issues/543","repository_url":"https://api.github.com/repos/airbnb/caravel","labels_url":"https://api.github.com/repos/airbnb/caravel/issues/543/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/caravel/issues/543/comments","events_url":"https://api.github.com/repos/airbnb/caravel/issues/543/events","html_url":"https://github.com/airbnb/caravel/issues/543","id":157863310,"number":543,"title":"UnicodeEncodeError with python 3","user":{"login":"IljaKroonen","id":6551900,"avatar_url":"https://avatars.githubusercontent.com/u/6551900?v=3","gravatar_id":"","url":"https://api.github.com/users/IljaKroonen","html_url":"https://github.com/IljaKroonen","followers_url":"https://api.github.com/users/IljaKroonen/followers","following_url":"https://api.github.com/users/IljaKroonen/following{/other_user}","gists_url":"https://api.github.com/users/IljaKroonen/gists{/gist_id}","starred_url":"https://api.github.com/users/IljaKroonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IljaKroonen/subscriptions","organizations_url":"https://api.github.com/users/IljaKroonen/orgs","repos_url":"https://api.github.com/users/IljaKroonen/repos","events_url":"https://api.github.com/users/IljaKroonen/events{/privacy}","received_events_url":"https://api.github.com/users/IljaKroonen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-01T09:36:09Z","updated_at":"2016-06-01T10:52:37Z","closed_at":null,"body":"I'm running caravel on python3.4 and in a docker based on ubuntu 14. When I select a filter value that contains an accent (for example, \"Société\"), I get the following error on all my slices.\r\nThe datasource is SQL Server (azure version).\r\nIn other instances, for example when accents are shown as labels in visualizations, it works perfectly fine.\r\n\r\n```\r\nbuiltins.UnicodeEncodeError\r\nUnicodeEncodeError: 'ascii' codec can't encode character '\\xe9' in position 244: ordinal not in range(128)\r\n\r\nTraceback (most recent call last)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 2000, in __call__\r\nreturn self.wsgi_app(environ, start_response)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1991, in wsgi_app\r\nresponse = self.make_response(self.handle_exception(e))\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1567, in handle_exception\r\nreraise(exc_type, exc_value, tb)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/_compat.py\", line 33, in reraise\r\nraise value\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1988, in wsgi_app\r\nresponse = self.full_dispatch_request()\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1641, in full_dispatch_request\r\nrv = self.handle_user_exception(e)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1544, in handle_user_exception\r\nreraise(exc_type, exc_value, tb)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/_compat.py\", line 33, in reraise\r\nraise value\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1639, in full_dispatch_request\r\nrv = self.dispatch_request()\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask-0.11-py3.4.egg/flask/app.py\", line 1625, in dispatch_request\r\nreturn self.view_functions[rule.endpoint](**req.view_args)\r\nFile \"/usr/local/lib/python3.4/dist-packages/Flask_AppBuilder-1.7.0-py3.4.egg/flask_appbuilder/security/decorators.py\", line 26, in wraps\r\nreturn f(self, *args, **kwargs)\r\nFile \"/caravel/source/caravel/models.py\", line 1305, in wrapper\r\nreturn f(*args, **kwargs)\r\nFile \"/caravel/source/caravel/views.py\", line 671, in explore\r\npayload = obj.get_json()\r\nFile \"/caravel/source/caravel/viz.py\", line 260, in get_json\r\n'data': self.get_data(),\r\nFile \"/caravel/source/caravel/viz.py\", line 370, in get_data\r\ndf = self.get_df()\r\nFile \"/caravel/source/caravel/viz.py\", line 362, in get_df\r\ndf = super(TableViz, self).get_df(query_obj)\r\nFile \"/caravel/source/caravel/viz.py\", line 146, in get_df\r\nself.results = self.datasource.query(**query_obj)\r\nFile \"/caravel/source/caravel/models.py\", line 729, in query\r\nprint(sql)\r\nUnicodeEncodeError: 'ascii' codec can't encode character '\\xe9' in position 244: ordinal not in range(128)\r\nThe debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.\r\nTo switch between the interactive traceback and the plaintext one, you can click on the \"Traceback\" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.\r\n```"},"comment":{"url":"https://api.github.com/repos/airbnb/caravel/issues/comments/222958669","html_url":"https://github.com/airbnb/caravel/issues/543#issuecomment-222958669","issue_url":"https://api.github.com/repos/airbnb/caravel/issues/543","id":222958669,"user":{"login":"IljaKroonen","id":6551900,"avatar_url":"https://avatars.githubusercontent.com/u/6551900?v=3","gravatar_id":"","url":"https://api.github.com/users/IljaKroonen","html_url":"https://github.com/IljaKroonen","followers_url":"https://api.github.com/users/IljaKroonen/followers","following_url":"https://api.github.com/users/IljaKroonen/following{/other_user}","gists_url":"https://api.github.com/users/IljaKroonen/gists{/gist_id}","starred_url":"https://api.github.com/users/IljaKroonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IljaKroonen/subscriptions","organizations_url":"https://api.github.com/users/IljaKroonen/orgs","repos_url":"https://api.github.com/users/IljaKroonen/repos","events_url":"https://api.github.com/users/IljaKroonen/events{/privacy}","received_events_url":"https://api.github.com/users/IljaKroonen/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T10:52:37Z","updated_at":"2016-06-01T10:52:37Z","body":"I found an easy fix for this issue, which is setting the PYTHONIOENCODING environment variable to UTF-8 (otherwise, python thinks it can't send UTF8 characters to the terminal)\r\nIn docker, this can be done with -e PYTHONIOENCODING=UTF-8"}}
{"actor":{"display_login":"IljaKroonen"}}