Done:
https://bitbucket.org/zzzeek/sqlalchemy/issue/3123/mysql-reflection-on-python-26-causes-error
FYI, for now we're patching sqlalchemy/engine/reflection.py, changing
Inspector.reflectable after it gets tbl_opts (line 450 in my code):
# reflect table options, like mysql_engine
tbl_opts = self.get_table_options(table_name, schema,
**table.dialect_kwargs)
# Python 2.6 doesn't except using dicts with unicode keys for
kwargs,
# ie, myFunc(**{u'foo':1}) will raise an error
if sys.version_info < (2, 7):
for key, val in tbl_opts.items():
if isinstance(key, unicode):
del tbl_opts[key]
tbl_opts[str(key)] = val
There's likely a much better / more elegant way to handle this, but it
seems to do the trick for us...
Let me know anything's not clear, or you're having troubles replicating, or
there's anything else I can do to help!
- Paul
On Thu, Jul 10, 2014 at 6:06 PM, Mike Bayer <[email protected]>
wrote:
>
> On 7/10/14, 3:49 PM, Paul Molodowitch wrote:
>
> Whoops! Just noticed this was the totally wrong traceback!
>
> Here's the correct trace:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "test.py", line 155, in <module>
> metadata.reflect(db.engine, only=tables)
> File "./sqlalchemy/sql/schema.py", line 3277, in reflect
> Table(name, self, **reflect_opts)
> File "./sqlalchemy/sql/schema.py", line 352, in __new__
> table._init(name, metadata, *args, **kw)
> File "./sqlalchemy/sql/schema.py", line 425, in _init
> self._autoload(metadata, autoload_with, include_columns)
> File "./sqlalchemy/sql/schema.py", line 437, in _autoload
> self, include_columns, exclude_columns
> File "./sqlalchemy/engine/base.py", line 1198, in run_callable
> return callable_(self, *args, **kwargs)
> File "./sqlalchemy/engine/default.py", line 355, in reflecttable
> return insp.reflecttable(table, include_columns, exclude_columns)
> File "./sqlalchemy/engine/reflection.py", line 463, in reflecttable
> for col_d in self.get_columns(table_name, schema,
> **table.dialect_kwargs):
> TypeError: get_columns() keywords must be strings
>
>
> with metadata.reflect(), OK. Can you please make a very short and
> self-contained test case and post a bug report? thanks.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sqlalchemy/E3MhX1m8QqQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.