I have started moving my code base from 0.7.10 to 0.8.7 as first step to getting
to current version. (There code changes for me to get to 0.9.x where there are
no code changes to run under 0.8.x)

I have found a problem with a query that worked on 0.7.10 and now fails
with a raise.

The code is failing in unit test which means the database is sqllite.

The klass is mapped class of table table_prl_paid_time_off.

earlist_predecessor: datetime.date(2012, 8, 16)
 last: datetime.date(2013, 4, 30)
 account: 151


Query:
    query = query.filter(
            and_(klass.account == account,
                earliest_predecessor <= klass.start_date <= last)
            ).order_by('start_date')

Traceback on 08.7:

Traceback (most recent call last):
  File "/home/batch/server-batch/prl/prl/models/t/prl_paid_time_off.py", line 13
8, in test_for_first_on_hire
    last, hire_date, self.warning_callback)
  File "/home/batch/server-batch/prl/prl/models/prl_paid_time_off.py", line 243,
 in get_headers
    earliest_predecessor <= klass.start_date <= last)
  File "build/bdist.linux-x86_64/egg/sqlalchemy/sql/expression.py", line 4479, i
n __nonzero__
    raise TypeError("Boolean value of this clause is not defined")
TypeError: Boolean value of this clause is not defined

The table is defined as:
def table_prl_paid_time_off(meta):
    prl_paid_time_off = Table("prl_paid_time_off", meta,
        Column('id', Integer(), primary_key=True, autoincrement=True),
        Column('account', BigInteger(), 
ForeignKey('prl_employee_master.account', ondelete='REST\
RICT', onupdate='RESTRICT'), index=True),
        Column('start_date', Date()),
        Column('end_date', Date()),
        Column('step_group', String(length=16)),
        Column('step', Integer()),
        Column('vacation_hours_granted', Numeric(precision=10, scale=2), 
nullable=True),
        Column('vacation_hours_used', Numeric(precision=10, scale=2), 
nullable=True),
        Column('sick_hours_granted', Numeric(precision=10, scale=2), 
nullable=True),
        Column('sick_hours_used', Numeric(precision=10, scale=2), 
nullable=True),
        Column('personal_hours_granted', Numeric(precision=10, scale=2), 
nullable=True),
        Column('personal_hours_used', Numeric(precision=10, scale=2), 
nullable=True),
ForeignKeyConstraint(['step_group','step'],['prl_vacation_step.step_group','prl_vacation\
_step.step'], ondelete='RESTRICT', onupdate='RESTRICT'),
        Index('prl_paid_time_off__vacation_step', 'step_group', 'step', 
unique=False),
    )

--
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to