Skip to content

Commit 2f36915

Browse files
author
Voronov Vladimir
committed
fix(sentry): fix typing
1 parent 229c445 commit 2f36915

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

fastapi_structlog/sentry/initialization.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Sentry configuration module."""
22
import logging
3+
from collections.abc import Container
34
from typing import Optional, Union
45

56
import sentry_sdk
@@ -12,14 +13,14 @@
1213
from .settings import SentrySettings
1314

1415

15-
def setup_sentry(
16+
def setup_sentry( # noqa: PLR0913
1617
settings_: SentrySettings,
1718
*,
1819
release: Optional[str] = None,
1920
app_slug: Optional[str] = None,
2021
version: Optional[str] = None,
2122
service_integration: Optional[Integration] = None,
22-
failed_request_status_codes: Optional[list[Union[int, range]]] = None,
23+
failed_request_status_codes: Optional[list[Union[int, Container[int]]]] = None,
2324
) -> None:
2425
"""Configuration of Sentry settings.
2526
@@ -30,10 +31,10 @@ def setup_sentry(
3031
version (Optional[str]): Version. Defaults to None.
3132
service_integration (Optional[Integration]): Integration for inter-service
3233
interaction. Defaults to None.
33-
failed_request_status_codes (Optional[list[Union[int, range]]]): A list of integers or
34-
containers (objects that allow membership checks via in) of integers that will determine
35-
which status codes should be reported to Sentry.
36-
See https://docs.sentry.io/platforms/python/integrations/starlette/
34+
failed_request_status_codes (Optional[list[Union[int, Container[int]]]]): A list
35+
of integers or containers (objects that allow membership checks via in)
36+
of integers that will determine which status codes should be reported
37+
to Sentry. See https://docs.sentry.io/platforms/python/integrations/starlette/
3738
"""
3839
release = release or f'{app_slug}@{version}'
3940

0 commit comments

Comments
 (0)