moto icon indicating copy to clipboard operation
moto copied to clipboard

Eventbridge Put events fails with the error: KeyError: 'time'

Open YanJinad opened this issue 6 months ago • 1 comments

When calling put_events with the eventbridge client, a key error is raised stating the 'time' field is missing from the event. However, adding the Time argument to the put_events method does not remove the issue.

Here is the full error:

utcfromtimestamp(event["time"])  # type: ignore[arg-type]
                     ~~~~~^^^^^^^^
KeyError: 'time'

ERROR: 'time'

Link to code causing issue

YanJinad avatar Jun 10 '25 09:06 YanJinad

Hi @YanJinad, can you share a small test case that triggers this error?

bblommers avatar Jun 10 '25 09:06 bblommers