core: Cache RunnableLambda deps (#29200)

`RunnableLambda`'s `deps` may do costly OS operation by calling
`get_function_nonlocals`.
So it's better to cache it.
See #29043
This commit is contained in:
Christophe Bornet 2025-01-23 19:09:07 +01:00 committed by GitHub
parent f795ab99ec
commit 618e550f06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4457,7 +4457,7 @@ class RunnableLambda(Runnable[Input, Output]):
module_name=module,
)
@property
@functools.cached_property
def deps(self) -> list[Runnable]:
"""The dependencies of this Runnable.