@@ -225,13 +225,13 @@ def on_operation(self) -> "Generator[None, None, None]":
225225
226226 yield
227227
228- if type (graphql_span ) is StreamedSpan :
228+ if isinstance (graphql_span , StreamedSpan ) :
229229 if execution_context .operation_name :
230230 segment = graphql_span ._segment
231231 segment .set_attribute ("sentry.span.source" , TransactionSource .COMPONENT )
232232 segment .set_attribute ("sentry.op" , op )
233233 segment .name = execution_context .operation_name
234- elif type (graphql_span ) is Span :
234+ elif isinstance (graphql_span , Span ) :
235235 transaction = graphql_span .containing_transaction
236236 if transaction and execution_context .operation_name :
237237 transaction .name = execution_context .operation_name
@@ -261,7 +261,7 @@ def on_validate(self) -> "Generator[None, None, None]":
261261
262262 yield
263263
264- if is_span_streaming_enabled and type (validation_span ) is StreamedSpan :
264+ if is_span_streaming_enabled and isinstance (validation_span , StreamedSpan ) :
265265 validation_span .end ()
266266 else :
267267 validation_span .finish ()
@@ -287,7 +287,7 @@ def on_parse(self) -> "Generator[None, None, None]":
287287
288288 yield
289289
290- if is_span_streaming_enabled and type (parsing_span ) is StreamedSpan :
290+ if is_span_streaming_enabled and isinstance (parsing_span , StreamedSpan ) :
291291 parsing_span .end ()
292292 else :
293293 parsing_span .finish ()
0 commit comments