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

FAIL tests/test_postgresql.py::PostgresqlOpTest::()::test_create_exclude_constraint_quoted_column #431

Closed
sqlalchemy-bot opened this Issue May 31, 2017 · 12 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented May 31, 2017

Migrated issue, originally created by Sandro Tosi (@sandrotosi)

Hello,
when building alembic 0.9.2 i got this error:

=========================== short test summary info ============================
FAIL tests/test_postgresql.py::PostgresqlOpTest::()::test_create_exclude_constraint_quoted_column

=================================== FAILURES ===================================
________ PostgresqlOpTest.test_create_exclude_constraint_quoted_column _________
Traceback (most recent call last):
  File "/build/alembic-0.9.2/tests/test_postgresql.py", line 112, in test_create_exclude_constraint_quoted_column
    where=column("SomeColumn") > 5, using="gist")
  File "<string>", line 8, in create_exclude_constraint
  File "<string>", line 3, in create_exclude_constraint
  File "/build/alembic-0.9.2/alembic/ddl/postgresql.py", line 349, in create_exclude_constraint
    return operations.invoke(op)
  File "/build/alembic-0.9.2/alembic/operations/base.py", line 318, in invoke
    return fn(self, operation)
  File "/build/alembic-0.9.2/alembic/operations/toimpl.py", line 135, in create_constraint
    operation.to_constraint(operations.migration_context)
  File "/build/alembic-0.9.2/alembic/ddl/postgresql.py", line 299, in to_constraint
    **self.kw
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/dialects/postgresql/constraints.py", line 87, in __init__
    if where:
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 2746, in __bool__
    raise TypeError("Boolean value of this clause is not defined")
TypeError: Boolean value of this clause is not defined
============== 1 failed, 866 passed, 188 skipped in 6.39 seconds ===============

we're using sqlalchemy 1.0.8

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Sandro Tosi (@sandrotosi) wrote:

that error goes away udpating to sqlalchemy 1.1.6, so maybe you should bump the requirements in setup.py to that version (or smth newer than the 0.7.6 currently there)

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Michael Bayer (@zzzeek) wrote:

SQLAlchemy versions 0.7.X or so, through current, are supported. In this case you are hitting a bug that was repaired in 1.0.10, although the bug is not noted in the changelog (which is highly unusual). It was fixed in PR zzzeek/sqlalchemy#215.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Michael Bayer (@zzzeek) wrote:

(note the test in question is only supported for the 1.0.x series or higher)

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Michael Bayer (@zzzeek) wrote:

if you could clarify for me your "build" where you need the test suite to run against an obsolete SQLAlchemy version, that would help. I can mark these tests with more specific "failing" in that case.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Sandro Tosi (@sandrotosi) wrote:

yeah but you dont check that! (and it's also not true as with 1.0.8 the bug is there only; so 1.0.x with x >= 10)

you need to guard that check with the version of sqla: if it's lower than X (with X the minimum version where the test can success) then skip it

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Sandro Tosi (@sandrotosi) wrote:

i was building alembic against the debian jessie backport version of sqlalchemy; while it is not the most up-to-date, according to the requirement versions, it is supported, so tests shouldnt fail if running against taht version

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to reopened
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Sandro Tosi (@sandrotosi) wrote:

nice!! thanks a ton for the super-fast fix!

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Michael Bayer (@zzzeek) wrote:

  • Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
    prior to version 1.0.10 where a particular bug involving Postgresql
    exclude constraints was fixed.

Change-Id: Ief64b19b75e4c2c3661ac95d5b03d0c8e0fe5619
Fixes: #431

b526a11

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 31, 2017

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment