Bug 1298066 - not compatible with SQLAlchemy 1.0: AttributeError: 'SQLiteCompiler' object has no attribute '_get_colparams'
not compatible with SQLAlchemy 1.0: AttributeError: 'SQLiteCompiler' object h...
Product: Beaker
Classification: Community
Component: general (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 23.0
: ---
Assigned To: Roman Joost
Dan Callaghan
: Patch
Depends On:
  Show dependency treegraph
Reported: 2016-01-13 01:37 EST by Dan Callaghan
Modified: 2016-07-07 19:12 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-07 19:12:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2016-01-13 01:37:55 EST
F23+ plus has SQLAlchemy 1.0. Unit tests fail like this:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/suite.py", line 209, in run
  File "/usr/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
  File "/usr/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/usr/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/tests/__init__.py", line 19, in setup_package
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/tests/data_setup.py", line 56, in setup_model
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/tools/init.py", line 67, in populate_db
    user = User.lazy_create(user_name=user_name.decode('utf8'))
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/model/base.py", line 59, in lazy_create
    unique_params, extra_params))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1003, in _execute_clauseelement
    inline=len(distilled_params) > 1)
  File "<string>", line 1, in <lambda>
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 494, in compile
    return self._compiler(dialect, bind=bind, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 500, in _compiler
    return dialect.statement_compiler(dialect, self, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 392, in __init__
    Compiled.__init__(self, dialect, statement, **kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 190, in __init__
    self.string = self.process(self.statement, **compile_kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 213, in process
    return obj._compiler_dispatch(self, **kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 413, in <lambda>
    lambda *arg, **kw: existing(*arg, **kw))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 451, in __call__
    return fn(element, compiler, **kw)
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/model/sql.py", line 30, in visit_conditional_insert
    colparams = compiler._get_colparams(element)
AttributeError: 'SQLiteCompiler' object has no attribute '_get_colparams'
Comment 1 Roman Joost 2016-01-15 00:00:16 EST
Patch available:


The tricky thing with this is, that we're using private methods in order to create the SQL statements. The private method has been moved to a function in a separate module from SQLAlchemy 1.0 onwards.

The patch basically assumes we're running SQLAlchemy 1.0 already and if it fails importing the module fails back to pre 1.0 behaviour, calling the private methods on the compiler instance.
Comment 3 Dan Callaghan 2016-04-05 07:02:35 EDT
Marking this as VERIFIED based on the fact that the Fedora 23/rawhide unit tests (which is where we originally saw this problem) are passing with this patch.

We are *not* planning a migration to SQLAlchemy 1.0 in the near future, and we aren't expecting everything to actually work necessarily on SQLAlchemy 1.0, so there is no need for us to actually test Beaker fully against 1.0. Just the passing tests is enough for now.
Comment 4 Dan Callaghan 2016-07-07 19:12:05 EDT
Beaker 23.0 has been released.

Note You need to log in before you can comment on or make changes to this bug.