Skip to content

Commit

Permalink
Fix test in test_type_hints.py
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario committed Sep 22, 2022
1 parent 6fb9c59 commit afc4eed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/flytekit/unit/core/test_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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():
Expand Down

0 comments on commit afc4eed

Please sign in to comment.