remove bare list, dict, Sequence, None, Any (#25058)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Asuka Minato
2025-09-06 04:32:23 +09:00
committed by GitHub
parent 2b0695bdde
commit a78339a040
306 changed files with 787 additions and 817 deletions

View File

@@ -23,7 +23,7 @@ class TestWorkflowResponseConverterFetchFilesFromVariableValue:
storage_key="storage_key_123",
)
def create_file_dict(self, file_id: str = "test_file_dict") -> dict:
def create_file_dict(self, file_id: str = "test_file_dict"):
"""Create a file dictionary with correct dify_model_identity"""
return {
"dify_model_identity": FILE_MODEL_IDENTITY,

View File

@@ -83,7 +83,7 @@ def test_client_session_initialize():
# Create message handler
def message_handler(
message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception,
) -> None:
):
if isinstance(message, Exception):
raise message

View File

@@ -777,7 +777,7 @@ def test_condition_parallel_correct_output(mock_close, mock_remove, app):
},
{
"data": {
"code": '\ndef main(arg1: str, arg2: str) -> dict:\n return {\n "result": arg1 + arg2,\n }\n', # noqa: E501
"code": '\ndef main(arg1: str, arg2: str):\n return {\n "result": arg1 + arg2,\n }\n',
"code_language": "python3",
"desc": "",
"outputs": {"result": {"children": None, "type": "string"}},

View File

@@ -233,7 +233,7 @@ FAIL_BRANCH_EDGES = [
def test_code_default_value_continue_on_error():
error_code = """
def main() -> dict:
def main():
return {
"result": 1 / 0,
}
@@ -259,7 +259,7 @@ def test_code_default_value_continue_on_error():
def test_code_fail_branch_continue_on_error():
error_code = """
def main() -> dict:
def main():
return {
"result": 1 / 0,
}

View File

@@ -276,7 +276,7 @@ def test_array_file_contains_file_name():
assert result.outputs["result"] is True
def _get_test_conditions() -> list:
def _get_test_conditions():
conditions = [
# Test boolean "is" operator
{"comparison_operator": "is", "variable_selector": ["start", "bool_true"], "value": "true"},

View File

@@ -379,7 +379,7 @@ class TestVariablePoolSerialization:
self._assert_pools_equal(reconstructed_dict, reconstructed_json)
# TODO: assert the data for file object...
def _assert_pools_equal(self, pool1: VariablePool, pool2: VariablePool) -> None:
def _assert_pools_equal(self, pool1: VariablePool, pool2: VariablePool):
"""Assert that two VariablePools contain equivalent data"""
# Compare system variables