rethinkdb-python
rethinkdb-python copied to clipboard
Python driver incorrectly requires datetime.date type to have tzinfo
Python datetime.date types cannot have tzinfo because timezone only has meaning when a time is associated with it. Here's a simple script to demonstrate the issue:
try:
r.table_create("test_date").run(conn)
r.table("test_date").wait().run(conn)
except r.errors.ReqlOpFailedError as e:
pass
try:
r.table("test_date").insert({"id": 1, "date": date(2016, 1, 1)})
except r.errors.ReqlOpFailedError as e:
print("Failed:", e)