refactor(workflow): remove redundant get_base_node_data() method (#28803)

This commit is contained in:
-LAN-
2025-11-28 15:38:46 +08:00
committed by GitHub
parent 6f927b4a62
commit dd3b1ccd45
4 changed files with 23 additions and 27 deletions

View File

@@ -744,7 +744,7 @@ def test_graph_run_emits_partial_success_when_node_failure_recovered():
)
llm_node = graph.nodes["llm"]
base_node_data = llm_node.get_base_node_data()
base_node_data = llm_node.node_data
base_node_data.error_strategy = ErrorStrategy.DEFAULT_VALUE
base_node_data.default_value = [DefaultValue(key="text", value="fallback response", type=DefaultValueType.STRING)]

View File

@@ -471,8 +471,8 @@ class TestCodeNodeInitialization:
assert node._get_description() is None
def test_get_base_node_data(self):
"""Test get_base_node_data returns node data."""
def test_node_data_property(self):
"""Test node_data property returns node data."""
node = CodeNode.__new__(CodeNode)
node._node_data = CodeNodeData(
title="Base Test",
@@ -482,7 +482,7 @@ class TestCodeNodeInitialization:
outputs={},
)
result = node.get_base_node_data()
result = node.node_data
assert result == node._node_data
assert result.title == "Base Test"

View File

@@ -240,8 +240,8 @@ class TestIterationNodeInitialization:
assert node._get_description() == "This is a description"
def test_get_base_node_data(self):
"""Test get_base_node_data returns node data."""
def test_node_data_property(self):
"""Test node_data property returns node data."""
node = IterationNode.__new__(IterationNode)
node._node_data = IterationNodeData(
title="Base Test",
@@ -249,7 +249,7 @@ class TestIterationNodeInitialization:
output_selector=["y"],
)
result = node.get_base_node_data()
result = node.node_data
assert result == node._node_data