Skip to content

Commit 604694e

Browse files
committed
core: Fix some private member accesses
1 parent f14bcee commit 604694e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

libs/core/langchain_core/runnables/graph_ascii.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,21 @@ def box(self, x0: int, y0: int, width: int, height: int) -> None:
163163
self.point(x0 + width, y0 + height, "+")
164164

165165

166+
class _EdgeViewer:
167+
def __init__(self) -> None:
168+
self.pts: list[tuple[float]] = []
169+
170+
def setpath(self, pts: list[tuple[float]]) -> None:
171+
self.pts = pts
172+
173+
166174
def _build_sugiyama_layout(
167175
vertices: Mapping[str, str], edges: Sequence[LangEdge]
168176
) -> Any:
169177
try:
170178
from grandalf.graphs import Edge, Graph, Vertex # type: ignore[import-untyped]
171179
from grandalf.layouts import SugiyamaLayout # type: ignore[import-untyped]
172-
from grandalf.routing import ( # type: ignore[import-untyped]
173-
EdgeViewer,
174-
route_with_lines,
175-
)
180+
from grandalf.routing import route_with_lines # type: ignore[import-untyped]
176181
except ImportError as exc:
177182
msg = "Install grandalf to draw graphs: `pip install grandalf`."
178183
raise ImportError(msg) from exc
@@ -199,7 +204,7 @@ def _build_sugiyama_layout(
199204
minw = min(v.view.w for v in vertices_list)
200205

201206
for edge in edges_:
202-
edge.view = EdgeViewer()
207+
edge.view = _EdgeViewer()
203208

204209
sug = SugiyamaLayout(graph.C[0])
205210
graph = graph.C[0]

libs/core/langchain_core/tracers/langchain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def log_error_once(method: str, exception: Exception) -> None:
5151
def wait_for_all_tracers() -> None:
5252
"""Wait for all tracers to finish."""
5353
if rt._CLIENT is not None:
54-
rt._CLIENT.flush()
54+
get_client().flush()
5555

5656

5757
def get_client() -> Client:

0 commit comments

Comments
 (0)