From 1c86489192c9ae8c2a830870c68bd8f998bb960a Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Wed, 10 Jul 2024 16:33:05 +0200 Subject: [PATCH] ref(tracing): Update `NoOpSpan.finish` signature Make the same changes previously made to `Transaction.finish`. --- sentry_sdk/tracing.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index 80a38b1e43..f1f3200035 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -1205,8 +1205,17 @@ def get_profile_context(self): # type: () -> Any return {} - def finish(self, hub=None, end_timestamp=None): - # type: (Optional[Union[sentry_sdk.Hub, sentry_sdk.Scope]], Optional[Union[float, datetime]]) -> Optional[str] + def finish( + self, + scope=None, # type: Optional[sentry_sdk.Scope] + end_timestamp=None, # type: Optional[Union[float, datetime]] + *, + hub=None, # type: Optional[sentry_sdk.Hub] + ): + # type: (...) -> Optional[str] + """ + The `hub` parameter is deprecated. Please use the `scope` parameter, instead. + """ pass def set_measurement(self, name, value, unit=""):