You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/08 19:49:43 UTC

[GitHub] [incubator-superset] nawazxy opened a new issue #9494: Unable to load examples on a MySQL database

nawazxy opened a new issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494
 
 
   I've a MySQL database running on an EC2 instance and Superset running in a docker container.
   Pythonpath has been set, SQLAlchemy URI defined in **superset_config.py** file as well.
   **superset db upgrade** and **superset init** command run successfully.
   However, **superset load_examples** throws a UnicodeEncodeError error after loading a few examples, only two dashboards are visible on the UI.
   
   ### Expected results
   
   superset load_examples command runs successfully with no errors and example dashboards loaded on the UI
   
   ### Actual results (error log below)
   
   UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   
   1. Create a MySQL database for superset. i've set charset to utf8 and collate to utf8_bin on this DB.
   2. Run superset within a docker container, (mysqlclient installed via requirements.txt file), define the SQLAlchemy URI in the superset_config.py file.
   2. Login to the superset container and run superset db upgrade, init and load_examples commands.
   4. See error
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `0.36`
   - python version: `3.6.9`
   - mysqlclient: `1.4.6`
   - SQLAlchemy: `1.3.12`
   - SQLAlchemy-Utils: `0.36.1`
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   Creating table [birth_names] reference
   Creating some slices
   Creating a dashboard
   Loading [Unicode test data]
   Traceback (most recent call last):
     File "/usr/local/bin/superset", line 7, in <module>
       exec(compile(f.read(), __file__, 'exec'))
     File "/app/superset/bin/superset", line 21, in <module>
       superset()
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
       return self.main(*args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 586, in main
       return super(FlaskGroup, self).main(*args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
       rv = self.invoke(ctx)
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
       return callback(*args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 426, in decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
       return callback(*args, **kwargs)
     File "/app/superset/cli.py", line 148, in load_examples
       load_examples_run(load_test_data, only_metadata, force)
     File "/app/superset/cli.py", line 97, in load_examples_run
       examples.load_unicode_test_data(only_metadata, force)
     File "/app/superset/examples/unicode_test_data.py", line 65, in load_unicode_test_data
       index=False,
     File "/usr/local/lib/python3.6/site-packages/pandas/core/generic.py", line 2712, in to_sql
       method=method,
     File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 518, in to_sql
       method=method,
     File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 1320, in to_sql
       table.insert(chunksize, method=method)
     File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 756, in insert
       exec_insert(conn, keys, chunk_iter)
     File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 670, in _execute_insert
       conn.execute(self.table.insert(), data)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 982, in execute
       return meth(self, multiparams, params)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
       return connection._execute_clauseelement(self, multiparams, params)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1101, in _execute_clauseelement
       distilled_params,
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1250, in _execute_context
       e, statement, parameters, cursor, context
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1478, in _handle_dbapi_exception
       util.reraise(*exc_info)
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
       raise value
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1226, in _execute_context
       cursor, statement, parameters, context
     File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 148, in do_executemany
       rowcount = cursor.executemany(statement, parameters)
     File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 237, in executemany
       self._get_db().encoding)
     File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 253, in _do_execute_many
       v = values % escape(next(args), conn)
     File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 113, in _escape_args
       ret = tuple(literal(ensure_bytes(arg)) for arg in args)
     File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 113, in <genexpr>
       ret = tuple(literal(ensure_bytes(arg)) for arg in args)
     File "/usr/local/lib/python3.6/site-packages/MySQLdb/cursors.py", line 105, in ensure_bytes
       return x.encode(encoding)
     File "/usr/local/lib/python3.6/encodings/cp1252.py", line 12, in encode
       return codecs.charmap_encode(input,errors,encoding_table)
   UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187461
 
 
   🏷 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187817
 
 
   🗑 🏷 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187706
 
 
   🏷 🗑 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch removed a comment on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187706
 
 
   🏷 🗑 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187817
 
 
   🗑 🏷 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #9494: Unable to load examples on a MySQL database 
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-611187461
 
 
   🏷 .database

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nawazxy commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
nawazxy commented on issue #9494:
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-655668967


   I couldn't fix it mate :/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] tooptoop4 commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
tooptoop4 commented on issue #9494:
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-655441792


   @nawazxy how did u fix?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] fastZhe commented on issue #9494: Unable to load examples on a MySQL database

Posted by GitBox <gi...@apache.org>.
fastZhe commented on issue #9494:
URL: https://github.com/apache/incubator-superset/issues/9494#issuecomment-659208311


   I work use mysql `mysql://user:pw@ip/superset-example?charset=utf8`  ,this `charset=utf8` must


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org