Skip to content

span.set_data does not exist on StreamedSpan #6166

@Quetute

Description

@Quetute

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.58.0

Steps to Reproduce

With 0c4a75d, span.get_current_span() can now return a StreamedSpan.
This break the recommended way in the documentation https://docs.sentry.io/platforms/python/tracing/span-lifecycle/#improving-span-data to set data on a span, as set_data does not exist on a StreamedSpan anymore.
As a workaround, I can add a check if isinstance(span, Span): before, but that does not seem ideal.

Expected Result

sentry_sdk.get_current_span().set_data('foo', 'bar') # Type checker happy 

Actual Result

sentry_sdk.get_current_span().set_data('foo', 'bar') # Type checker not happy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions