Bug 1298066 - not compatible with SQLAlchemy 1.0: AttributeError: 'SQLiteCompiler' object has no attribute '_get_colparams'
Summary: not compatible with SQLAlchemy 1.0: AttributeError: 'SQLiteCompiler' object h...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: develop
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 23.0
Assignee: Roman Joost
QA Contact: Dan Callaghan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-13 06:37 UTC by Dan Callaghan
Modified: 2016-07-07 23:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-07 23:12:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2016-01-13 06:37:55 UTC
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
    self.setUp()
  File "/usr/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  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
    data_setup.setup_model()
  File "/builddir/build/BUILD/beaker-23.0.git.0.fba885c/Server/bkr/server/tests/data_setup.py", line 56, in setup_model
    user_email_address=ADMIN_EMAIL_ADDRESS)
  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 05:00:16 UTC
Patch available:

http://gerrit.beaker-project.org/4589

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 11:02:35 UTC
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 23:12:05 UTC
Beaker 23.0 has been released.


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