python-driver
python-driver copied to clipboard
CQLEngine stores naive timezone information - without an established default timezone
Using a datetime column the timezone information is lost and timestamp is sent off as is, where it is seemingly interpreted as UTC-0 timezone, leading to a confusion. I'm suggesting to instead convert said timestamp into UTC one if its timezone differs before submitting.
from uuid import uuid4
from datetime import datetime
from cassandra.cqlengine import models
from cassandra.cqlengine import columns
class Example(models.Model):
pk = columns.UUID(primary_key=True, default=uuid4)
indexed_list = columns.DateTime(default=datetime.now)
@k0machi can you report this one upstream ?
@k0machi Is there an upstream issue opened? If so, I'd like to close this one.