From 8e0d35e9575d7d9416a9b7192d20e8172357f5d1 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 30 Oct 2020 11:24:58 +0100 Subject: [PATCH 1/2] fix: Correct types on set_context --- sentry_sdk/api.py | 2 +- sentry_sdk/scope.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/api.py b/sentry_sdk/api.py index 658777ec79..5667035b0f 100644 --- a/sentry_sdk/api.py +++ b/sentry_sdk/api.py @@ -159,7 +159,7 @@ def set_tag(key, value): @scopemethod # noqa def set_context(key, value): - # type: (str, Any) -> None + # type: (str, dict) -> None return Hub.current.scope.set_context(key, value) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 3aaca430a1..18c0603275 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -232,7 +232,7 @@ def remove_tag( def set_context( self, key, # type: str - value, # type: Any + value, # type: dict ): # type: (...) -> None """Binds a context at a certain key to a specific value.""" From dd1de6656037d258a77deabe5143131af7a97c07 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 2 Nov 2020 19:15:10 +0100 Subject: [PATCH 2/2] fix typing --- sentry_sdk/api.py | 2 +- sentry_sdk/scope.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/api.py b/sentry_sdk/api.py index 5667035b0f..29bd8988db 100644 --- a/sentry_sdk/api.py +++ b/sentry_sdk/api.py @@ -159,7 +159,7 @@ def set_tag(key, value): @scopemethod # noqa def set_context(key, value): - # type: (str, dict) -> None + # type: (str, Dict[str, Any]) -> None return Hub.current.scope.set_context(key, value) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 18c0603275..f471cda3d4 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -232,7 +232,7 @@ def remove_tag( def set_context( self, key, # type: str - value, # type: dict + value, # type: Dict[str, Any] ): # type: (...) -> None """Binds a context at a certain key to a specific value."""