From 3dfed17907981d127cdebe5f83e1da66a92e906b Mon Sep 17 00:00:00 2001 From: Niels Bantilan Date: Wed, 22 Mar 2023 17:41:36 -0400 Subject: [PATCH 1/2] move FlyteSchema deprecation warning to initialization method Signed-off-by: Niels Bantilan --- flytekit/types/schema/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flytekit/types/schema/types.py b/flytekit/types/schema/types.py index c380bcc481..8313f81aa1 100644 --- a/flytekit/types/schema/types.py +++ b/flytekit/types/schema/types.py @@ -186,7 +186,6 @@ class FlyteSchema(object): """ This is the main schema class that users should use. """ - logger.warning("FlyteSchema is deprecated, use Structured Dataset instead.") @classmethod def columns(cls) -> typing.Dict[str, typing.Type]: @@ -240,6 +239,7 @@ def __init__( supported_mode: SchemaOpenMode = SchemaOpenMode.WRITE, downloader: typing.Optional[typing.Callable] = None, ): + logger.warning("FlyteSchema is deprecated, use Structured Dataset instead.") if supported_mode == SchemaOpenMode.READ and remote_path is None: raise ValueError("To create a FlyteSchema in read mode, remote_path is required") if ( From b6d778eb464f784a8f667ac3d64eb245ea3db737 Mon Sep 17 00:00:00 2001 From: Niels Bantilan Date: Wed, 22 Mar 2023 18:03:55 -0400 Subject: [PATCH 2/2] update Signed-off-by: Niels Bantilan --- flytekit/types/schema/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flytekit/types/schema/types.py b/flytekit/types/schema/types.py index 8313f81aa1..ac6b71ba38 100644 --- a/flytekit/types/schema/types.py +++ b/flytekit/types/schema/types.py @@ -202,6 +202,7 @@ def format(cls) -> SchemaFormat: def __class_getitem__( cls, columns: typing.Dict[str, typing.Type], fmt: SchemaFormat = SchemaFormat.PARQUET ) -> Type[FlyteSchema]: + logger.warning("FlyteSchema is deprecated, use Structured Dataset instead.") if columns is None: return FlyteSchema