Skip to content

Commit 0031e4d

Browse files
committed
Fix unpacking of negative timestamps from msgpack
- Update the work of PR influxdata#734 to correctly interpret negative timestamps
1 parent fc0235e commit 0031e4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

influxdb/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ def _parse_netloc(netloc):
12431243

12441244
def _msgpack_parse_hook(code, data):
12451245
if code == 5:
1246-
(epoch_s, epoch_ns) = struct.unpack(">QI", data)
1246+
(epoch_s, epoch_ns) = struct.unpack(">qI", data)
12471247
timestamp = datetime.datetime.utcfromtimestamp(epoch_s)
12481248
timestamp += datetime.timedelta(microseconds=(epoch_ns / 1000))
12491249
return timestamp.isoformat() + 'Z'

0 commit comments

Comments
 (0)