From afc4eedd3f89e365db8f5bd18391c170e5253d85 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Thu, 22 Sep 2022 16:25:24 -0700 Subject: [PATCH] Fix test in test_type_hints.py Signed-off-by: Eduardo Apolinario --- tests/flytekit/unit/core/test_type_hints.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/flytekit/unit/core/test_type_hints.py b/tests/flytekit/unit/core/test_type_hints.py index abdf69f5b0..04ea85113e 100644 --- a/tests/flytekit/unit/core/test_type_hints.py +++ b/tests/flytekit/unit/core/test_type_hints.py @@ -1811,11 +1811,11 @@ def wf(a: int) -> str: del TypeEngine._REGISTRY[MyInt] -def test_task_annotate_primitive_type_has_no_effect(): +def test_task_annotate_primitive_type_is_allowed(): @task def plus_two( a: int, - ) -> Annotated[int, HashMethod(str)]: # Note the use of `str` as the hash function for ints. This has no effect. + ) -> Annotated[int, HashMethod(lambda x: str(x + 1))]: return a + 2 assert plus_two(a=1) == 3 @@ -1832,7 +1832,7 @@ def plus_two( ), ) assert output_lm.literals["o0"].scalar.primitive.integer == 5 - assert output_lm.literals["o0"].hash is None + assert output_lm.literals["o0"].hash == "6" def test_task_hash_return_pandas_dataframe():