Commit edb5f7a
fix(python): round sub-millisecond durations in to_timedelta_int (#1668)
* fix(python): round sub-millisecond durations in to_timedelta_int
A timedelta carries microsecond precision, so `x.total_seconds() * 1000.0`
in `to_timedelta_int` can be a non-integer float (e.g. 1.234). The old
`is_integer()` assert then failed on such durations and aborted SessionEvent
serialization. Round to the nearest whole millisecond instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(python): clarify banker's rounding in to_timedelta_int comment
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent b49fbab commit edb5f7a
2 files changed
Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2538 | 2538 | | |
2539 | 2539 | | |
2540 | 2540 | | |
2541 | | - | |
2542 | | - | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
2543 | 2544 | | |
2544 | 2545 | | |
2545 | 2546 | | |
| |||
0 commit comments