correct way to use .alter to update element event.Event datatype #1275
Unanswered
trose-neuro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
As discussed on slack, I’m currently facing a quantization issue with the old Elements
event.Event
schema: theevent_start_time
andevent_end_time
attributes are quantized to ~10 ms for times exceeding 1000s because the datatype isfloat
.I see that
decimal(10,4)
was introduced in a later version ofevent.py
.We therefore have to change the datatype safely post-hoc in our rather large database. However, running on test data, I fail to get the
.alter
method to run.What’s the correct way to use .alter() here?
event_start_time
is a primary key.thanks,
Tobias
What I tried
I changed the event.Event schema definition from
float
todecimal(10,4)
:Then loaded an old test database
Event.describe() shows float as it should:
'-> BehaviorRecording\n-> EventType\nevent_start_time : float # (second) relative to recording start\n---\nevent_end_time=null : float # (second) relative to recording start\n'
However, restarting the kernel and then using
Event.alter()
yieldsBeta Was this translation helpful? Give feedback.
All reactions