pyrqlite icon indicating copy to clipboard operation
pyrqlite copied to clipboard

rqlite does not like empty DATETIME columns

Open MRB60 opened this issue 1 year ago • 1 comments

I get the following error unless I set defaults in datetime columns:

venv/lib/python3.8/site-packages/pyrqlite/extensions.py", line 111, in <lambda> 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z')

MRB60 avatar Mar 21 '23 14:03 MRB60

I commented wrong version - I am using sqlalchemy. Sorry.

MRB60 avatar Mar 21 '23 14:03 MRB60

I was facing similar issue, I have updated venv/lib/python3.8/site-packages/pyrqlite/extensions.py:

Line 111 (https://github.com/rqlite/pyrqlite/blob/master/src/pyrqlite/extensions.py#L111): Replaced: 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z') With: 'DATETIME': lambda x: x.replace('T', ' ').rstrip('Z') if x is not None else None,

Then it supported empty Datetime for me.

harpreetkhanuja51 avatar May 24 '24 08:05 harpreetkhanuja51

Fixed by https://github.com/rqlite/pyrqlite/pull/62 and released in v2.2.3 (24d91e025f25efd1fe89215647eb2cc882c1802a).

zmedico avatar May 26 '24 22:05 zmedico

Thanks @zmedico

otoolep avatar May 27 '24 01:05 otoolep