Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Dec 15, 2023
1 parent f0d45f8 commit 3fdd0a8
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/dispatch/signal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,16 @@ def update_instance(
return signal_instance


def filter_snooze(*, db_session: Session, signal_instance: SignalInstance) -> bool:
def filter_snooze(*, db_session: Session, signal_instance: SignalInstance) -> SignalInstance:
"""Filters a signal instance for snoozing.
Args:
db_session (Session): Database session.
signal_instance (SignalInstance): Signal instance to be filtered.
Returns:
SignalInstance: The filtered signal instance.
"""
for f in signal_instance.signal.filters:
if f.mode != SignalFilterMode.active:
continue
Expand Down Expand Up @@ -598,7 +607,16 @@ def filter_snooze(*, db_session: Session, signal_instance: SignalInstance) -> bo
return signal_instance


def filter_dedup(*, db_session: Session, signal_instance: SignalInstance) -> bool:
def filter_dedup(*, db_session: Session, signal_instance: SignalInstance) -> SignalInstance:
"""Filters a signal instance for deduplication.
Args:
db_session (Session): Database session.
signal_instance (SignalInstance): Signal instance to be filtered.
Returns:
SignalInstance: The filtered signal instance.
"""
for f in signal_instance.signal.filters:
if f.mode != SignalFilterMode.active:
continue
Expand Down

0 comments on commit 3fdd0a8

Please sign in to comment.