remove .value (#26633)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Asuka Minato
2025-10-11 10:08:29 +09:00
committed by GitHub
parent bb6a331490
commit 1bd621f819
138 changed files with 613 additions and 633 deletions

View File

@@ -140,7 +140,7 @@ class TestCeleryWorkflowExecutionRepository:
assert call_args["execution_data"] == sample_workflow_execution.model_dump()
assert call_args["tenant_id"] == mock_account.current_tenant_id
assert call_args["app_id"] == "test-app"
assert call_args["triggered_from"] == WorkflowRunTriggeredFrom.APP_RUN.value
assert call_args["triggered_from"] == WorkflowRunTriggeredFrom.APP_RUN
assert call_args["creator_user_id"] == mock_account.id
# Verify no task tracking occurs (no _pending_saves attribute)

View File

@@ -149,7 +149,7 @@ class TestCeleryWorkflowNodeExecutionRepository:
assert call_args["execution_data"] == sample_workflow_node_execution.model_dump()
assert call_args["tenant_id"] == mock_account.current_tenant_id
assert call_args["app_id"] == "test-app"
assert call_args["triggered_from"] == WorkflowNodeExecutionTriggeredFrom.WORKFLOW_RUN.value
assert call_args["triggered_from"] == WorkflowNodeExecutionTriggeredFrom.WORKFLOW_RUN
assert call_args["creator_user_id"] == mock_account.id
# Verify execution is cached

View File

@@ -145,12 +145,12 @@ class TestSQLAlchemyWorkflowNodeExecutionRepositoryTruncation:
db_model.index = 1
db_model.predecessor_node_id = None
db_model.node_id = "node-id"
db_model.node_type = NodeType.LLM.value
db_model.node_type = NodeType.LLM
db_model.title = "Test Node"
db_model.inputs = json.dumps({"value": "inputs"})
db_model.process_data = json.dumps({"value": "process_data"})
db_model.outputs = json.dumps({"value": "outputs"})
db_model.status = WorkflowNodeExecutionStatus.SUCCEEDED.value
db_model.status = WorkflowNodeExecutionStatus.SUCCEEDED
db_model.error = None
db_model.elapsed_time = 1.0
db_model.execution_metadata = "{}"

View File

@@ -147,7 +147,7 @@ class TestRedisChannel:
"""Test deserializing an abort command."""
channel = RedisChannel(MagicMock(), "test:key")
abort_data = {"command_type": CommandType.ABORT.value}
abort_data = {"command_type": CommandType.ABORT}
command = channel._deserialize_command(abort_data)
assert isinstance(command, AbortCommand)
@@ -158,7 +158,7 @@ class TestRedisChannel:
channel = RedisChannel(MagicMock(), "test:key")
# For now, only ABORT is supported, but test generic handling
generic_data = {"command_type": CommandType.ABORT.value}
generic_data = {"command_type": CommandType.ABORT}
command = channel._deserialize_command(generic_data)
assert command is not None

View File

@@ -56,8 +56,8 @@ def test_mock_iteration_node_preserves_config():
workflow_id="test",
graph_config={"nodes": [], "edges": []},
user_id="test",
user_from=UserFrom.ACCOUNT.value,
invoke_from=InvokeFrom.SERVICE_API.value,
user_from=UserFrom.ACCOUNT,
invoke_from=InvokeFrom.SERVICE_API,
call_depth=0,
)
@@ -117,8 +117,8 @@ def test_mock_loop_node_preserves_config():
workflow_id="test",
graph_config={"nodes": [], "edges": []},
user_id="test",
user_from=UserFrom.ACCOUNT.value,
invoke_from=InvokeFrom.SERVICE_API.value,
user_from=UserFrom.ACCOUNT,
invoke_from=InvokeFrom.SERVICE_API,
call_depth=0,
)

View File

@@ -49,7 +49,7 @@ class TestRedisStopIntegration:
# Verify the command data
command_json = calls[0][0][1]
command_data = json.loads(command_json)
assert command_data["command_type"] == CommandType.ABORT.value
assert command_data["command_type"] == CommandType.ABORT
assert command_data["reason"] == "Test stop"
def test_graph_engine_manager_handles_redis_failure_gracefully(self):
@@ -122,7 +122,7 @@ class TestRedisStopIntegration:
# Verify serialized command
command_json = calls[0][0][1]
command_data = json.loads(command_json)
assert command_data["command_type"] == CommandType.ABORT.value
assert command_data["command_type"] == CommandType.ABORT
assert command_data["reason"] == "User requested stop"
# Check expire was set
@@ -137,9 +137,7 @@ class TestRedisStopIntegration:
mock_redis.pipeline.return_value.__exit__ = Mock(return_value=None)
# Mock command data
abort_command_json = json.dumps(
{"command_type": CommandType.ABORT.value, "reason": "Test abort", "payload": None}
)
abort_command_json = json.dumps({"command_type": CommandType.ABORT, "reason": "Test abort", "payload": None})
# Mock pipeline execute to return commands
mock_pipeline.execute.return_value = [

View File

@@ -87,7 +87,7 @@ def test_overwrite_string_variable():
"data": {
"title": "test",
"assigned_variable_selector": ["conversation", conversation_variable.name],
"write_mode": WriteMode.OVER_WRITE.value,
"write_mode": WriteMode.OVER_WRITE,
"input_variable_selector": [DEFAULT_NODE_ID, input_variable.name],
},
}
@@ -189,7 +189,7 @@ def test_append_variable_to_array():
"data": {
"title": "test",
"assigned_variable_selector": ["conversation", conversation_variable.name],
"write_mode": WriteMode.APPEND.value,
"write_mode": WriteMode.APPEND,
"input_variable_selector": [DEFAULT_NODE_ID, input_variable.name],
},
}
@@ -282,7 +282,7 @@ def test_clear_array():
"data": {
"title": "test",
"assigned_variable_selector": ["conversation", conversation_variable.name],
"write_mode": WriteMode.CLEAR.value,
"write_mode": WriteMode.CLEAR,
"input_variable_selector": [],
},
}