Skip to content

Commit

Permalink
Define a TypedDict to document the event payload input
Browse files Browse the repository at this point in the history
  • Loading branch information
ceholden committed Jan 29, 2025
1 parent f5f2a1b commit fee190d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lambdas/date_generator/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@
from collections.abc import Sequence
from datetime import datetime, timedelta
from itertools import product
from typing import TypedDict


class Event(TypedDict, total=False):
"""Input event payload
These inputs are not required but can be provided to override
behavior for unit testing or backfills. Defaults are set inside
of the handler function.
"""

platforms: Sequence[str]
now: str
lookback_days: int


DATE_FORMAT_YMD = "%Y-%m-%d"
DEFAULT_LOOKBACK_DAYS = 5


def handler(
event: dict,
event: Event,
_context,
):
"""
Expand Down

0 comments on commit fee190d

Please sign in to comment.