Skip to content

Commit 59162fa

Browse files
docs: fix inaccurate UNIXTIME decode comment about Go behavior
The comment incorrectly said the raw int64 return matches "Go's getInt64() behavior". Go's Rows.Next() actually converts UNIXTIME to time.Time, not raw int64. The Python choice to return raw int64 is correct for a wire protocol library, but the justification was wrong. Closes #109 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4866040 commit 59162fa

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/dqlitewire/types.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,12 @@ def decode_value(data: bytes, value_type: ValueType) -> tuple[Any, int]:
281281
elif value_type == ValueType.INTEGER:
282282
return decode_int64(data), 8
283283
elif value_type == ValueType.UNIXTIME:
284-
# Return raw int64 to match Go's getInt64() behavior and preserve
285-
# round-trip identity. Previously returned datetime.datetime, which
286-
# caused type-changing re-encode (UNIXTIME → ISO8601).
284+
# Return raw int64 to preserve round-trip identity at the wire level.
285+
# Previously returned datetime.datetime, which caused type-changing
286+
# re-encode (UNIXTIME → ISO8601). See issue 006.
287+
# Note: Go's Rows.Next() converts this to time.Time, but that
288+
# conversion belongs in a higher-level client layer, not the wire
289+
# protocol codec.
287290
return decode_int64(data), 8
288291
elif value_type == ValueType.FLOAT:
289292
return decode_double(data), 8

0 commit comments

Comments
 (0)