[Sqlalchemy-tickets] Issue #3655: BinaryExpression wrong type (datetime instead of date) (zzzeek/sq
Brought to you by:
zzzeek
From: Tom K. <iss...@bi...> - 2016-02-18 22:09:39
|
New issue 3655: BinaryExpression wrong type (datetime instead of date) https://bitbucket.org/zzzeek/sqlalchemy/issues/3655/binaryexpression-wrong-type-datetime Tom Kedem: Suppose I have the following arrangement: ``` class MyModel(Base): date = Column(Date) @hybrid_property def offset_date(self): return self.date + datetime.timedelta(days=1) ``` The `offset_date` type is `datetime` instead of `date`. I would expect the result of the `BinaryExpression` to evaluate to the same type of the column. This is in accordance to how python evaluates the addition: ``` >>> type(datetime.date.today() + datetime.timedelta(days=1)) <class 'datetime.date'> ``` I'm using the latest master to date. |