From 2762053d105e6c71825250d22157ef38de7550dc Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Wed, 19 Feb 2025 14:16:24 -0800 Subject: [PATCH 1/3] Fix test_invalid_ge_schema_batchrequest_pandas_config Signed-off-by: Kevin Su --- flytekit/core/type_engine.py | 1 - plugins/flytekit-greatexpectations/tests/test_schema.py | 4 +++- tests/flytekit/integration/remote/test_remote.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flytekit/core/type_engine.py b/flytekit/core/type_engine.py index bcd34cf6f3..bdd8460c39 100644 --- a/flytekit/core/type_engine.py +++ b/flytekit/core/type_engine.py @@ -1532,7 +1532,6 @@ async def _literal_map_to_kwargs( raise TypeTransformerFailedError( f"Error converting input '{k}' at position {i}:\n" f"Literal value: {lm.literals[k]}\n" - f"Literal type: {literal_types}\n" f"Expected Python type: {python_interface_inputs[k]}\n" f"Exception: {e}" ) diff --git a/plugins/flytekit-greatexpectations/tests/test_schema.py b/plugins/flytekit-greatexpectations/tests/test_schema.py index f9a63634ad..aee36d7e94 100644 --- a/plugins/flytekit-greatexpectations/tests/test_schema.py +++ b/plugins/flytekit-greatexpectations/tests/test_schema.py @@ -5,6 +5,8 @@ import pandas as pd import pytest + +from flytekit.core.type_engine import TypeTransformerFailedError from flytekitplugins.great_expectations import BatchRequestConfig, GreatExpectationsFlyteConfig, GreatExpectationsType from great_expectations.exceptions import InvalidBatchRequestError, ValidationError @@ -144,7 +146,7 @@ def my_wf(): my_task(directory="my_assets") # Capture IndexError - with pytest.raises(InvalidBatchRequestError): + with pytest.raises(TypeTransformerFailedError): my_wf() diff --git a/tests/flytekit/integration/remote/test_remote.py b/tests/flytekit/integration/remote/test_remote.py index 3babe86c45..e2c813ecec 100644 --- a/tests/flytekit/integration/remote/test_remote.py +++ b/tests/flytekit/integration/remote/test_remote.py @@ -916,8 +916,8 @@ def test_attr_access_sd(): execution_id = run("attr_access_sd.py", "wf", "--uri", remote_file_path) remote = FlyteRemote(Config.auto(config_file=CONFIG), PROJECT, DOMAIN) execution = remote.fetch_execution(name=execution_id) - execution = remote.wait(execution=execution, timeout=datetime.timedelta(minutes=5)) - print("Execution Error:", execution.error) + execution = remote.wait(execution=execution, timeout=datetime.timedelta(minutes=10)) + assert execution.error is None, f"Execution failed with error: {execution.error}" assert execution.closure.phase == WorkflowExecutionPhase.SUCCEEDED, f"Execution failed with phase: {execution.closure.phase}" # Delete the remote file to free the space From 7460f2b0f4a8553e45f9b4bf016a97c8872c3d5a Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Wed, 19 Feb 2025 14:47:31 -0800 Subject: [PATCH 2/3] nit Signed-off-by: Kevin Su --- plugins/flytekit-greatexpectations/tests/test_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/flytekit-greatexpectations/tests/test_schema.py b/plugins/flytekit-greatexpectations/tests/test_schema.py index aee36d7e94..a418672581 100644 --- a/plugins/flytekit-greatexpectations/tests/test_schema.py +++ b/plugins/flytekit-greatexpectations/tests/test_schema.py @@ -60,7 +60,7 @@ def invalid_wf(dataset: str = "yellow_tripdata_sample_2019-02.csv") -> int: valid_result = valid_wf() assert valid_result == 9999 - with pytest.raises(ValidationError): + with pytest.raises(TypeTransformerFailedError): invalid_wf() From 5f87d6b7d696b965c1991ef3a3f73a9329da26d1 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Wed, 19 Feb 2025 15:26:49 -0800 Subject: [PATCH 3/3] nit Signed-off-by: Kevin Su --- tests/flytekit/integration/remote/test_remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flytekit/integration/remote/test_remote.py b/tests/flytekit/integration/remote/test_remote.py index e2c813ecec..8c6e55b5cf 100644 --- a/tests/flytekit/integration/remote/test_remote.py +++ b/tests/flytekit/integration/remote/test_remote.py @@ -916,7 +916,7 @@ def test_attr_access_sd(): execution_id = run("attr_access_sd.py", "wf", "--uri", remote_file_path) remote = FlyteRemote(Config.auto(config_file=CONFIG), PROJECT, DOMAIN) execution = remote.fetch_execution(name=execution_id) - execution = remote.wait(execution=execution, timeout=datetime.timedelta(minutes=10)) + execution = remote.wait(execution=execution, timeout=datetime.timedelta(minutes=5)) assert execution.error is None, f"Execution failed with error: {execution.error}" assert execution.closure.phase == WorkflowExecutionPhase.SUCCEEDED, f"Execution failed with phase: {execution.closure.phase}"