@@ -71,7 +71,7 @@ def _extract_bound(instance):
71
71
return instance
72
72
73
73
74
- def _flatmap_chain_steps (steps : List [Any ], nested : bool = True ) -> List [Any ]:
74
+ def _flattened_chain_steps (steps : List [Any ], nested : bool = True ) -> List [Any ]:
75
75
"""
76
76
Flattens the contents of a chain into non-RunnableBindings and non-RunnableParallel steps.
77
77
RunnableParrallel steps are extracted and can either be nested into sublists or flattened.
@@ -111,7 +111,7 @@ def record_steps(self, instance, span):
111
111
return
112
112
113
113
steps = getattr (instance , "steps" , [])
114
- for step in _flatmap_chain_steps (steps , nested = False ):
114
+ for step in _flattened_chain_steps (steps , nested = False ):
115
115
self ._chain_steps .add (id (step ))
116
116
117
117
self .record_instance (instance , span )
@@ -237,7 +237,7 @@ def _set_input_links(self, instance: Any, span: Span, parent_span: Union[Span, N
237
237
238
238
chain_instance = _extract_bound (self ._instances .get (invoker_spans [0 ]))
239
239
steps = getattr (chain_instance , "steps" , [])
240
- flatmap_chain_steps = _flatmap_chain_steps (steps )
240
+ flatmap_chain_steps = _flattened_chain_steps (steps )
241
241
for i , step in enumerate (flatmap_chain_steps ):
242
242
if id (step ) == id (instance ) or (
243
243
isinstance (step , list ) and any (id (sub_step ) == id (instance ) for sub_step in step )
@@ -322,7 +322,7 @@ def _get_popped_span_link_indecies(self, parent_span: Span, parent_links: List[D
322
322
return pop_indecies
323
323
324
324
steps = getattr (parent_instance , "steps" , [])
325
- flatmap_chain_steps = _flatmap_chain_steps (steps )
325
+ flatmap_chain_steps = _flattened_chain_steps (steps )
326
326
for i in range (step_idx - 1 , - 1 , - 1 ):
327
327
step = flatmap_chain_steps [i ]
328
328
if id (step ) in self ._spans :
0 commit comments