-
Notifications
You must be signed in to change notification settings - Fork 65
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
resolves bug with python3+pymysql #210
Open
rv816
wants to merge
1
commit into
blaze:master
Choose a base branch
from
rv816:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using python 3 ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/datashape/coretypes.py in __init__(self, *args) 395 try: --> 396 encoding = _canonical_string_encodings[encoding] 397 except KeyError: KeyError: 'utf8_bin' During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) <ipython-input-50-d24c1eaedb48> in <module>() 1 2 ----> 3 claims = blaze.Data(db.url) /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/blaze/interactive.py in Data(data, dshape, name, fields, schema, **kwargs) 117 dshape = datashape.dshape(dshape) 118 if not dshape: --> 119 dshape = discover(data) 120 types = None 121 if isinstance(dshape.measure, Tuple) and fields: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/multipledispatch/dispatcher.py in __call__(self, *args, **kwargs) 162 self._cache[types] = func 163 try: --> 164 return func(*args, **kwargs) 165 166 except MDNotImplementedError: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in discover(engine) 259 @dispatch(sa.engine.base.Engine) 260 def discover(engine): --> 261 return discover(metadata_of_engine(engine)) 262 263 /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/multipledispatch/dispatcher.py in __call__(self, *args, **kwargs) 162 self._cache[types] = func 163 try: --> 164 return func(*args, **kwargs) 165 166 except MDNotImplementedError: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in discover(metadata) 272 name = table.name 273 try: --> 274 pairs.append([name, discover(table)]) 275 except sa.exc.CompileError as e: 276 print("Can not discover type of table %s.\n" % name + /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/multipledispatch/dispatcher.py in __call__(self, *args, **kwargs) 162 self._cache[types] = func 163 try: --> 164 return func(*args, **kwargs) 165 166 except MDNotImplementedError: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in discover_sqlalchemy_selectable(t) 201 def discover_sqlalchemy_selectable(t): 202 ordering = dict((c, i) for i, c in enumerate(c for c in t.columns.keys())) --> 203 records = list(sum([discover(c).parameters[0] for c in t.columns], ())) 204 fkeys = [discover(fkey, t, parent_measure=Record(records)) 205 for fkey in t.foreign_keys] /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in <listcomp>(.0) 201 def discover_sqlalchemy_selectable(t): 202 ordering = dict((c, i) for i, c in enumerate(c for c in t.columns.keys())) --> 203 records = list(sum([discover(c).parameters[0] for c in t.columns], ())) 204 fkeys = [discover(fkey, t, parent_measure=Record(records)) 205 for fkey in t.foreign_keys] /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/multipledispatch/dispatcher.py in __call__(self, *args, **kwargs) 162 self._cache[types] = func 163 try: --> 164 return func(*args, **kwargs) 165 166 except MDNotImplementedError: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in discover_sqlalchemy_column(c) 195 def discover_sqlalchemy_column(c): 196 meta = Option if c.nullable else identity --> 197 return Record([(c.name, meta(discover(c.type)))]) 198 199 /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/multipledispatch/dispatcher.py in __call__(self, *args, **kwargs) 162 self._cache[types] = func 163 try: --> 164 return func(*args, **kwargs) 165 166 except MDNotImplementedError: /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/odo/backends/sql.py in discover_typeengine(typ) 173 return datashape.Decimal(precision=typ.precision, scale=typ.scale) 174 if isinstance(typ, (sa.String, sa.Unicode)): --> 175 return datashape.String(typ.length, typ.collation) 176 else: 177 for k, v in revtypes.items(): /Users/vassr/.virtualenvs/gapsincare/lib/python3.5/site-packages/datashape/coretypes.py in __init__(self, *args) 397 except KeyError: 398 raise ValueError('Unsupported string encoding %s' % --> 399 repr(encoding)) 400 401 self.encoding = encoding ValueError: Unsupported string encoding 'utf8_bin' ``` despite all manner of connection string permutations (with charset specification, without...etc), create_engine strategies, etc, blaze had trouble reading a mysql database that sqlalchemy, and, for that matter, pandas, had no issue with. using latest versions of everything adding this key to the `_canonical_string_encodings ` resolved this error
See also #176 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using python 3
despite all manner of connection string permutations (with charset specification, without...etc), create_engine strategies, etc, blaze had trouble reading a mysql database that sqlalchemy, and, for that matter, pandas, had no issue with. using latest versions of everything
adding this key to the
_canonical_string_encodings
resolved this error