@@ -277,29 +277,29 @@ def _set_output_links(self, span: Span, parent_span: Union[Span, None], prev_tra
277
277
return
278
278
279
279
parent_links = parent_span ._get_ctx_item (SPAN_LINKS ) or []
280
- pop_indecies = self ._get_popped_span_link_indecies (parent_span , parent_links , prev_traced_step_idx )
280
+ pop_indices = self ._get_popped_span_link_indices (parent_span , parent_links , prev_traced_step_idx )
281
281
282
- self ._set_span_links (parent_span , [span ], "output" , "output" , popped_span_link_indecies = pop_indecies )
282
+ self ._set_span_links (parent_span , [span ], "output" , "output" , popped_span_link_indices = pop_indices )
283
283
284
- def _get_popped_span_link_indecies (
284
+ def _get_popped_span_link_indices (
285
285
self , parent_span : Span , parent_links : List [Dict [str , Any ]], prev_traced_step_idx : int
286
286
) -> List [int ]:
287
287
"""
288
- Returns a list of indecies to pop from the parent span links list
288
+ Returns a list of indices to pop from the parent span links list
289
289
This is determined by if the parent span represents a chain, and if there are steps before the step
290
290
represented by the span that need to be removed.
291
291
292
292
This is a temporary stopgap until we trace virtually every step in the chain, and we know the last
293
293
step will be the last one traced.
294
294
"""
295
- pop_indecies : List [int ] = []
295
+ pop_indices : List [int ] = []
296
296
parent_instance = self ._instances .get (parent_span )
297
297
if not parent_instance or prev_traced_step_idx == - 1 :
298
- return pop_indecies
298
+ return pop_indices
299
299
300
300
parent_instance = _extract_bound (parent_instance )
301
301
if not hasattr (parent_instance , "steps" ): # chain instance
302
- return pop_indecies
302
+ return pop_indices
303
303
304
304
steps = getattr (parent_instance , "steps" , [])
305
305
flatmap_chain_steps = _flattened_chain_steps (steps )
@@ -313,28 +313,28 @@ def _get_popped_span_link_indecies(
313
313
(i for i , link in enumerate (parent_links ) if link ["span_id" ] == str (invoker_span_id )), None
314
314
)
315
315
if link_idx is not None :
316
- pop_indecies .append (link_idx )
316
+ pop_indices .append (link_idx )
317
317
else :
318
318
invoker_span_id = self ._spans [id (prev_traced_step )].span_id
319
319
link_idx = next ((i for i , link in enumerate (parent_links ) if link ["span_id" ] == str (invoker_span_id )), None )
320
320
if link_idx is not None :
321
- pop_indecies .append (link_idx )
321
+ pop_indices .append (link_idx )
322
322
323
- return pop_indecies
323
+ return pop_indices
324
324
325
325
def _set_span_links (
326
326
self ,
327
327
span : Span ,
328
328
from_spans : List [Span ],
329
329
link_from : str ,
330
330
link_to : str ,
331
- popped_span_link_indecies : Optional [List [int ]] = None ,
331
+ popped_span_link_indices : Optional [List [int ]] = None ,
332
332
) -> None :
333
333
"""Sets the span links on the given span along with the existing links."""
334
334
existing_links = span ._get_ctx_item (SPAN_LINKS ) or []
335
335
336
- if popped_span_link_indecies :
337
- existing_links = [link for i , link in enumerate (existing_links ) if i not in popped_span_link_indecies ]
336
+ if popped_span_link_indices :
337
+ existing_links = [link for i , link in enumerate (existing_links ) if i not in popped_span_link_indices ]
338
338
339
339
links = [
340
340
{
0 commit comments