Type as self

This commit is contained in:
Nuno Campos
2024-08-26 13:14:11 -07:00
parent 25a72e77ef
commit 3979bdb792
+1 -3
View File
@@ -227,9 +227,7 @@ class Pregel(
class Config:
arbitrary_types_allowed = True
def with_config(
self, config: RunnableConfig | None = None, **kwargs: Any
) -> Runnable[Dict[All, Any] | Any, Dict[All, Any] | Any]:
def with_config(self, config: RunnableConfig | None = None, **kwargs: Any) -> Self:
return self.copy(
update={"config": cast(RunnableConfig, {**(config or {}), **kwargs})}
)