mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
tdb_cassandra: Let pycassa serialize timestamp when validated.
Pycassa will do its own marshalling when columns have validators specified in the C* metadata. We need to disable our own marshalling when we know Pycassa will take care of it. This is already taken care of in the general case, but timestamps are handled somewhat uniquely.
This commit is contained in:
@@ -580,7 +580,8 @@ class ThingBase(object):
|
||||
s_now = self._serialize_date(datetime.now(tz))
|
||||
now = self._deserialize_date(s_now)
|
||||
|
||||
updates[self._timestamp_prop] = s_now
|
||||
timestamp_is_typed = self._get_column_validator(self._timestamp_prop) == "DateType"
|
||||
updates[self._timestamp_prop] = now if timestamp_is_typed else s_now
|
||||
self._dirties[self._timestamp_prop] = now
|
||||
|
||||
if not updates and not self._deletes:
|
||||
|
||||
Reference in New Issue
Block a user