Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: William FH <13333726+hinthornw@users.noreply.github.com>
  • Loading branch information
nfcampos and hinthornw authored Sep 19, 2024
1 parent 95c1ca3 commit a47dc2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libs/langgraph/langgraph/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def add_node(
"Node name must be provided if action is not a function"
)
if action is None:
raise RuntimeError
raise RuntimeError(f"Expected a function or Runnable action in add_node. Received None.")

Check failure on line 197 in libs/langgraph/langgraph/graph/graph.py

View workflow job for this annotation

GitHub Actions / cd libs/langgraph / lint #3.12

Ruff (F541)

langgraph/graph/graph.py:197:32: F541 f-string without any placeholders
if node in self.nodes:
raise ValueError(f"Node `{node}` already present.")
if node == END or node == START:
Expand Down
2 changes: 1 addition & 1 deletion libs/langgraph/langgraph/graph/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def add_node(
)
if not isinstance(node, str):
action = node
node = getattr(action, "name", getattr(action, "__name__"))
node = getattr(action, "name", getattr(action, "__name__", None))
if node is None:
raise ValueError(
"Node name must be provided if action is not a function"
Expand Down

0 comments on commit a47dc2b

Please sign in to comment.