Cannot use argument_for on DialectKWArgs not explicitly in construct_arguments

Issue #3024 resolved
Dennis Hennen created an issue

Using 0.9.4

from sqlalchemy.sql.expression import Insert
Insert.argument_for('mysql', 'foo', False)

returns

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    Insert.argument_for('mysql', 'foo', False)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/base.py", line 184, in argument_for
    construct_arg_dictionary[cls][argument_name] = default
KeyError: <class 'sqlalchemy.sql.dml.Insert'>

Because mysql doesn't have Insert explicitly in it's construct_arguments we get the KeyError.

Comments (2)

  1. Mike Bayer repo owner
    • Fixed bug in new :meth:.DialectKWArgs.argument_for method where adding an argument for a construct not previously included for any special arguments would fail. fixes #3024

    → <<cset 99ae0dc821a1>>

  2. Log in to comment