Skip to content

Commit df43f45

Browse files
authored
Fix start/end time corruption when reading via HTTP client (#683)
[ML-10926](https://iguazio.atlassian.net/browse/ML-10926)
1 parent 89860a4 commit df43f45

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

clients/py/tests/test_http.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ def test_format_go_time():
154154
assert offset == tz.utcoffset(now).total_seconds(), 'bad offset'
155155

156156

157+
# ML-10926
158+
def test_format_go_time_with_leading_zeroes():
159+
dt = datetime.fromisoformat("2025-09-10T12:00:35.001000")
160+
ts = v3f.http.format_go_time(dt)
161+
162+
assert ts == "2025-09-10T12:00:35.001000000+00:00"
163+
164+
157165
def new_test_client(address='', session=None):
158166
return v3f.HTTPClient(
159167
address=address or 'http://example.com',

clients/py/v3io_frames/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def format_go_time(dt):
319319
prefix = dt.strftime('%Y-%m-%dT%H:%M:%S')
320320
nsec = dt.microsecond * 1000
321321
tz = dt.strftime('%z') or '+0000'
322-
return '{}.{}{}:{}'.format(prefix, nsec, tz[:3], tz[3:5])
322+
return '{}.{:09d}{}:{}'.format(prefix, nsec, tz[:3], tz[3:5])
323323

324324

325325
def convert_go_times(d, keys):

0 commit comments

Comments
 (0)