Skip to content

Commit

Permalink
fix(eda): make offset optional for nonetype (#553)
Browse files Browse the repository at this point in the history
since offset was of type int, it failed trying to convert `NoneType` to
an integer when it was not set by default. Using the Optional[int]
allows us to handle this situation to maintain our optional use of
offset.
  • Loading branch information
carlosmmatos authored Sep 1, 2024
1 parent e895fc1 commit 7bfb185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/eda/plugins/event_source/eventstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def __init__(
self: "Stream",
client: AIOFalconAPI,
stream_name: str,
offset: int,
offset: Optional[int],
latest: bool,
include_event_types: list[str],
stream: dict,
Expand Down Expand Up @@ -441,7 +441,7 @@ async def main(queue: asyncio.Queue, args: dict[str, Any]) -> None:
falcon_client_secret: str = str(args.get("falcon_client_secret"))
falcon_cloud: str = str(args.get("falcon_cloud", "us-1"))
stream_name: str = str(args.get("stream_name", "eda")).lower()
offset: int = int(args.get("offset"))
offset: Optional[int] = args.get("offset")
latest: bool = bool(args.get("latest", False))
delay: float = float(args.get("delay", 0))
include_event_types: list[str] = list(args.get("include_event_types", []))
Expand Down

0 comments on commit 7bfb185

Please sign in to comment.