diff --git a/api/migrations/versions/47cc7df8c4f3_modify_default_model_name_length.py b/api/migrations/versions/47cc7df8c4f3_modify_default_model_name_length.py deleted file mode 100644 index b37928d3c0..0000000000 --- a/api/migrations/versions/47cc7df8c4f3_modify_default_model_name_length.py +++ /dev/null @@ -1,39 +0,0 @@ -"""modify default model name length - -Revision ID: 47cc7df8c4f3 -Revises: 3c7cac9521c6 -Create Date: 2024-05-10 09:48:09.046298 - -""" -import sqlalchemy as sa -from alembic import op - -import models as models - -# revision identifiers, used by Alembic. -revision = '47cc7df8c4f3' -down_revision = '3c7cac9521c6' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('tenant_default_models', schema=None) as batch_op: - batch_op.alter_column('model_name', - existing_type=sa.VARCHAR(length=40), - type_=sa.String(length=255), - existing_nullable=False) - - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('tenant_default_models', schema=None) as batch_op: - batch_op.alter_column('model_name', - existing_type=sa.String(length=255), - type_=sa.VARCHAR(length=40), - existing_nullable=False) - - # ### end Alembic commands ### diff --git a/api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py b/api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py index e8d8efb97c..714ef1160e 100644 --- a/api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py +++ b/api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py @@ -398,7 +398,13 @@ def test_run_branch(mock_close, mock_remove): "id": "start", }, { - "data": {"answer": "1 {{#start.uid#}}", "title": "Answer", "type": "answer", "variables": [], "outputs": []}, + "data": { + "answer": "1 {{#start.uid#}}", + "title": "Answer", + "type": "answer", + "variables": [], + "outputs": [], + }, "id": "answer-1", }, { diff --git a/api/tests/unit_tests/core/workflow/nodes/iteration/test_iteration.py b/api/tests/unit_tests/core/workflow/nodes/iteration/test_iteration.py index 7db224ba3f..00a38d9802 100644 --- a/api/tests/unit_tests/core/workflow/nodes/iteration/test_iteration.py +++ b/api/tests/unit_tests/core/workflow/nodes/iteration/test_iteration.py @@ -89,7 +89,12 @@ def test_run(): "id": "tt", }, { - "data": {"answer": "{{#iteration-1.output#}}88888", "title": "answer 3", "type": "answer", "outputs": []}, + "data": { + "answer": "{{#iteration-1.output#}}88888", + "title": "answer 3", + "type": "answer", + "outputs": [], + }, "id": "answer-3", }, { @@ -110,7 +115,13 @@ def test_run(): "id": "if-else", }, { - "data": {"answer": "no hi", "iteration_id": "iteration-1", "title": "answer 4", "type": "answer", "outputs": []}, + "data": { + "answer": "no hi", + "iteration_id": "iteration-1", + "title": "answer 4", + "type": "answer", + "outputs": [], + }, "id": "answer-4", }, { @@ -307,7 +318,12 @@ def test_run_parallel(): "id": "tt-2", }, { - "data": {"answer": "{{#iteration-1.output#}}88888", "title": "answer 3", "type": "answer", "outputs": []}, + "data": { + "answer": "{{#iteration-1.output#}}88888", + "title": "answer 3", + "type": "answer", + "outputs": [], + }, "id": "answer-3", }, { @@ -328,7 +344,13 @@ def test_run_parallel(): "id": "if-else", }, { - "data": {"answer": "no hi", "iteration_id": "iteration-1", "title": "answer 4", "type": "answer", "outputs": []}, + "data": { + "answer": "no hi", + "iteration_id": "iteration-1", + "title": "answer 4", + "type": "answer", + "outputs": [], + }, "id": "answer-4", }, { @@ -524,7 +546,12 @@ def test_iteration_run_in_parallel_mode(): "id": "tt-2", }, { - "data": {"answer": "{{#iteration-1.output#}}88888", "title": "answer 3", "type": "answer", "outputs": []}, + "data": { + "answer": "{{#iteration-1.output#}}88888", + "title": "answer 3", + "type": "answer", + "outputs": [], + }, "id": "answer-3", }, { @@ -545,7 +572,13 @@ def test_iteration_run_in_parallel_mode(): "id": "if-else", }, { - "data": {"answer": "no hi", "iteration_id": "iteration-1", "title": "answer 4", "type": "answer", "outputs": []}, + "data": { + "answer": "no hi", + "iteration_id": "iteration-1", + "title": "answer 4", + "type": "answer", + "outputs": [], + }, "id": "answer-4", }, { @@ -744,7 +777,12 @@ def test_iteration_run_error_handle(): "id": "tt2", }, { - "data": {"answer": "{{#iteration-1.output#}}88888", "title": "answer 3", "type": "answer", "outputs": []}, + "data": { + "answer": "{{#iteration-1.output#}}88888", + "title": "answer 3", + "type": "answer", + "outputs": [], + }, "id": "answer-3", }, { diff --git a/api/tests/unit_tests/core/workflow/nodes/test_continue_on_error.py b/api/tests/unit_tests/core/workflow/nodes/test_continue_on_error.py index 7802e88028..efe4be204b 100644 --- a/api/tests/unit_tests/core/workflow/nodes/test_continue_on_error.py +++ b/api/tests/unit_tests/core/workflow/nodes/test_continue_on_error.py @@ -239,7 +239,10 @@ def test_code_default_value_continue_on_error(): "edges": DEFAULT_VALUE_EDGE, "nodes": [ {"data": {"title": "start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, "id": "answer"}, + { + "data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, + "id": "answer", + }, ContinueOnErrorTestHelper.get_code_node( error_code, "default-value", [{"key": "result", "type": "number", "value": 132123}] ), @@ -292,7 +295,10 @@ def test_http_node_default_value_continue_on_error(): "edges": DEFAULT_VALUE_EDGE, "nodes": [ {"data": {"title": "start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "answer", "type": "answer", "answer": "{{#node.response#}}", "outputs": []}, "id": "answer"}, + { + "data": {"title": "answer", "type": "answer", "answer": "{{#node.response#}}", "outputs": []}, + "id": "answer", + }, ContinueOnErrorTestHelper.get_http_node( "default-value", [{"key": "response", "type": "string", "value": "http node got error response"}] ), @@ -395,7 +401,10 @@ def test_llm_node_default_value_continue_on_error(): "edges": DEFAULT_VALUE_EDGE, "nodes": [ {"data": {"title": "start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "answer", "type": "answer", "answer": "{{#node.answer#}}", "outputs": []}, "id": "answer"}, + { + "data": {"title": "answer", "type": "answer", "answer": "{{#node.answer#}}", "outputs": []}, + "id": "answer", + }, ContinueOnErrorTestHelper.get_llm_node( "default-value", [{"key": "answer", "type": "string", "value": "default LLM response"}] ), @@ -499,7 +508,10 @@ def test_no_node_in_fail_branch_continue_on_error(): "edges": FAIL_BRANCH_EDGES[:-1], "nodes": [ {"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "success", "type": "answer", "answer": "HTTP request successful", "outputs": []}, "id": "success"}, + { + "data": {"title": "success", "type": "answer", "answer": "HTTP request successful", "outputs": []}, + "id": "success", + }, ContinueOnErrorTestHelper.get_http_node(), ], } diff --git a/api/tests/unit_tests/core/workflow/nodes/test_retry.py b/api/tests/unit_tests/core/workflow/nodes/test_retry.py index 40ac03188d..d807fd5828 100644 --- a/api/tests/unit_tests/core/workflow/nodes/test_retry.py +++ b/api/tests/unit_tests/core/workflow/nodes/test_retry.py @@ -27,7 +27,10 @@ def test_retry_default_value_partial_success(): "edges": DEFAULT_VALUE_EDGE, "nodes": [ {"data": {"title": "start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, "id": "answer"}, + { + "data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, + "id": "answer", + }, ContinueOnErrorTestHelper.get_http_node( "default-value", [{"key": "result", "type": "string", "value": "http node got error response"}], @@ -50,7 +53,10 @@ def test_retry_failed(): "edges": DEFAULT_VALUE_EDGE, "nodes": [ {"data": {"title": "start", "type": "start", "variables": []}, "id": "start"}, - {"data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, "id": "answer"}, + { + "data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []}, + "id": "answer", + }, ContinueOnErrorTestHelper.get_http_node( None, None,