Skip to content

Commit 41e4321

Browse files
committed
fmt
1 parent 2431cae commit 41e4321

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

ddtrace/llmobs/_integrations/langchain.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -277,29 +277,29 @@ def _set_output_links(self, span: Span, parent_span: Union[Span, None], prev_tra
277277
return
278278

279279
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)
281281

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)
283283

284-
def _get_popped_span_link_indecies(
284+
def _get_popped_span_link_indices(
285285
self, parent_span: Span, parent_links: List[Dict[str, Any]], prev_traced_step_idx: int
286286
) -> List[int]:
287287
"""
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
289289
This is determined by if the parent span represents a chain, and if there are steps before the step
290290
represented by the span that need to be removed.
291291
292292
This is a temporary stopgap until we trace virtually every step in the chain, and we know the last
293293
step will be the last one traced.
294294
"""
295-
pop_indecies: List[int] = []
295+
pop_indices: List[int] = []
296296
parent_instance = self._instances.get(parent_span)
297297
if not parent_instance or prev_traced_step_idx == -1:
298-
return pop_indecies
298+
return pop_indices
299299

300300
parent_instance = _extract_bound(parent_instance)
301301
if not hasattr(parent_instance, "steps"): # chain instance
302-
return pop_indecies
302+
return pop_indices
303303

304304
steps = getattr(parent_instance, "steps", [])
305305
flatmap_chain_steps = _flattened_chain_steps(steps)
@@ -313,28 +313,28 @@ def _get_popped_span_link_indecies(
313313
(i for i, link in enumerate(parent_links) if link["span_id"] == str(invoker_span_id)), None
314314
)
315315
if link_idx is not None:
316-
pop_indecies.append(link_idx)
316+
pop_indices.append(link_idx)
317317
else:
318318
invoker_span_id = self._spans[id(prev_traced_step)].span_id
319319
link_idx = next((i for i, link in enumerate(parent_links) if link["span_id"] == str(invoker_span_id)), None)
320320
if link_idx is not None:
321-
pop_indecies.append(link_idx)
321+
pop_indices.append(link_idx)
322322

323-
return pop_indecies
323+
return pop_indices
324324

325325
def _set_span_links(
326326
self,
327327
span: Span,
328328
from_spans: List[Span],
329329
link_from: str,
330330
link_to: str,
331-
popped_span_link_indecies: Optional[List[int]] = None,
331+
popped_span_link_indices: Optional[List[int]] = None,
332332
) -> None:
333333
"""Sets the span links on the given span along with the existing links."""
334334
existing_links = span._get_ctx_item(SPAN_LINKS) or []
335335

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]
338338

339339
links = [
340340
{

0 commit comments

Comments
 (0)