Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/copilot/generated/session_events.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/codegen/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2538,8 +2538,8 @@ export function generatePythonSessionEventsCode(schema: JSONSchema7): string {
out.push(`def to_timedelta_int(x: timedelta) -> int:`);
out.push(` assert isinstance(x, timedelta)`);
out.push(` milliseconds = x.total_seconds() * 1000.0`);
out.push(` assert milliseconds.is_integer()`);
out.push(` return int(milliseconds)`);
out.push(` # Durations can carry sub-millisecond precision; round to the nearest whole ms.`);
out.push(` return round(milliseconds)`);
Comment on lines 2538 to +2542

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we care about such precision here, so bankers rounding is fine.

out.push(``);
out.push(``);
}
Expand Down