rethinkdb-python icon indicating copy to clipboard operation
rethinkdb-python copied to clipboard

Python driver incorrectly requires datetime.date type to have tzinfo

Open daveisfera opened this issue 9 years ago • 0 comments

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)

daveisfera avatar Oct 24 '16 19:10 daveisfera