diff --git a/flytekit/models/common.py b/flytekit/models/common.py index f0a0bd3385..8fdd0837a8 100644 --- a/flytekit/models/common.py +++ b/flytekit/models/common.py @@ -61,7 +61,8 @@ def short_string(self): :rtype: Text """ literal_str = re.sub(r"\s+", " ", str(self.to_flyte_idl())).strip() - return f"" + type_str = type(self).__name__ + return f"" def verbose_string(self): """ diff --git a/tests/flytekit/unit/core/test_promise.py b/tests/flytekit/unit/core/test_promise.py index 654bff0294..74f3db99e3 100644 --- a/tests/flytekit/unit/core/test_promise.py +++ b/tests/flytekit/unit/core/test_promise.py @@ -84,7 +84,7 @@ def wf(i: int, j: int): # without providing the _inputs_not_allowed or _ignorable_inputs, all inputs to lp become required, # which is incorrect - with pytest.raises(FlyteAssertion, match="Missing input `i` type ``"): + with pytest.raises(FlyteAssertion, match=r"Missing input `i` type ``"): create_and_link_node_from_remote(ctx, lp) # Even if j is not provided it will default diff --git a/tests/flytekit/unit/core/test_type_hints.py b/tests/flytekit/unit/core/test_type_hints.py index 3fa9579bd5..e3b0978565 100644 --- a/tests/flytekit/unit/core/test_type_hints.py +++ b/tests/flytekit/unit/core/test_type_hints.py @@ -1701,7 +1701,7 @@ def wf2(a: typing.Union[int, str]) -> typing.Union[int, str]: match=re.escape( "Error encountered while executing 'wf2':\n" f" Failed to convert inputs of task '{prefix}tests.flytekit.unit.core.test_type_hints.t2':\n" - ' Cannot convert from to typing.Union[float, dict] (using tag str)' ), ): diff --git a/tests/flytekit/unit/models/test_common.py b/tests/flytekit/unit/models/test_common.py index 48e8c0ba1f..b3754c16ff 100644 --- a/tests/flytekit/unit/models/test_common.py +++ b/tests/flytekit/unit/models/test_common.py @@ -103,3 +103,10 @@ def test_auth_role_empty(): x = obj.to_flyte_idl() y = _common.AuthRole.from_flyte_idl(x) assert y == obj + + +def test_short_string_raw_output_data_config(): + """""" + obj = _common.RawOutputDataConfig("s3://bucket") + assert "FlyteLiteral(RawOutputDataConfig)" in obj.short_string() + assert "FlyteLiteral(RawOutputDataConfig)" in repr(obj)