Skip to content

Commit 26a2445

Browse files
Use datetime(3) for Job table timestamps
- Add fractional seconds precision support to datetime core type - Replace timestamp(3) with datetime(3) in Job table definition - Eliminates native type warnings for job table timestamps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2a7aed2 commit 26a2445

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/datajoint/declare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"bytes": (r"bytes$", "longblob"),
3939
# Temporal
4040
"date": (r"date$", None),
41-
"datetime": (r"datetime$", None),
41+
"datetime": (r"datetime(\s*\(\d+\))?$", None), # datetime with optional fractional seconds precision
4242
# String types (with parameters)
4343
"char": (r"char\s*\(\d+\)$", None),
4444
"varchar": (r"varchar\s*\(\d+\)$", None),

src/datajoint/jobs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def _generate_definition(self) -> str:
127127
---
128128
status : enum('pending', 'reserved', 'success', 'error', 'ignore')
129129
priority : uint8
130-
created_time=CURRENT_TIMESTAMP(3) : timestamp(3)
131-
scheduled_time=CURRENT_TIMESTAMP(3) : timestamp(3)
132-
reserved_time=null : timestamp(3)
133-
completed_time=null : timestamp(3)
130+
created_time=CURRENT_TIMESTAMP(3) : datetime(3)
131+
scheduled_time=CURRENT_TIMESTAMP(3) : datetime(3)
132+
reserved_time=null : datetime(3)
133+
completed_time=null : datetime(3)
134134
duration=null : float64
135135
error_message="" : varchar({ERROR_MESSAGE_LENGTH})
136136
error_stack=null : <blob>

0 commit comments

Comments
 (0)