From 9fbf1ecbc50591877f09918e818d14fbbc63d316 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 6 May 2022 14:01:35 -0700 Subject: [PATCH 1/3] Add some fixes Signed-off-by: Kevin Zhang --- .../infra/offline_stores/contrib/spark_offline_store/spark.py | 2 ++ sdk/python/feast/infra/offline_stores/offline_store.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py index 770bd8adc21..87928ee26fb 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py +++ b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py @@ -32,6 +32,8 @@ from feast.type_map import spark_schema_to_np_dtypes from feast.usage import log_exceptions_and_usage +# Make sure spark warning doesn't raise more than once. +warnings.simplefilter("once", RuntimeWarning) class SparkOfflineStoreConfig(FeastConfigBaseModel): type: StrictStr = "spark" diff --git a/sdk/python/feast/infra/offline_stores/offline_store.py b/sdk/python/feast/infra/offline_stores/offline_store.py index 27a85046e5b..2996a1ed590 100644 --- a/sdk/python/feast/infra/offline_stores/offline_store.py +++ b/sdk/python/feast/infra/offline_stores/offline_store.py @@ -32,6 +32,8 @@ if TYPE_CHECKING: from feast.saved_dataset import ValidationReference +warnings.simplefilter("once", RuntimeWarning) + class RetrievalMetadata: min_event_timestamp: Optional[datetime] From f87cec74d1cf17fad7d7442b91005f38c021e3be Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 11 May 2022 14:35:00 -0700 Subject: [PATCH 2/3] Punt deprecation warnings to 0.23 Signed-off-by: Kevin Zhang --- sdk/python/feast/cli.py | 4 ++-- sdk/python/feast/diff/registry_diff.py | 2 +- sdk/python/feast/entity.py | 2 +- sdk/python/feast/feature_store.py | 2 +- sdk/python/feast/feature_view.py | 4 ++-- .../infra/offline_stores/bigquery_source.py | 4 ++-- .../contrib/spark_offline_store/spark_source.py | 2 +- .../feast/infra/offline_stores/file_source.py | 2 +- .../infra/offline_stores/redshift_source.py | 4 ++-- .../infra/offline_stores/snowflake_source.py | 4 ++-- sdk/python/feast/on_demand_feature_view.py | 16 ++++++++-------- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sdk/python/feast/cli.py b/sdk/python/feast/cli.py index 944ff1a21a7..d87f6260a70 100644 --- a/sdk/python/feast/cli.py +++ b/sdk/python/feast/cli.py @@ -167,7 +167,7 @@ def data_source_describe(ctx: click.Context, name: str): warnings.warn( "Describing data sources will only work properly if all data sources have names or table names specified. " - "Starting Feast 0.21, data source unique names will be required to encourage data source discovery.", + "Starting Feast 0.23, data source unique names will be required to encourage data source discovery.", RuntimeWarning, ) print( @@ -194,7 +194,7 @@ def data_source_list(ctx: click.Context): warnings.warn( "Listing data sources will only work properly if all data sources have names or table names specified. " - "Starting Feast 0.21, data source unique names will be required to encourage data source discovery", + "Starting Feast 0.23, data source unique names will be required to encourage data source discovery", RuntimeWarning, ) print(tabulate(table, headers=["NAME", "CLASS"], tablefmt="plain")) diff --git a/sdk/python/feast/diff/registry_diff.py b/sdk/python/feast/diff/registry_diff.py index b2caec2b687..4304068fed7 100644 --- a/sdk/python/feast/diff/registry_diff.py +++ b/sdk/python/feast/diff/registry_diff.py @@ -61,7 +61,7 @@ def to_string(self): if feast_object_diff.transition_type == TransitionType.UNCHANGED: continue if feast_object_diff.feast_object_type == FeastObjectType.DATA_SOURCE: - # TODO(adchia): Print statements out starting in Feast 0.21 + # TODO(adchia): Print statements out starting in Feast 0.23 continue action, color = message_action_map[feast_object_diff.transition_type] log_string += f"{action} {feast_object_diff.feast_object_type.value} {Style.BRIGHT + color}{feast_object_diff.name}{Style.RESET_ALL}\n" diff --git a/sdk/python/feast/entity.py b/sdk/python/feast/entity.py index 38c353857c9..1e7c7cf3079 100644 --- a/sdk/python/feast/entity.py +++ b/sdk/python/feast/entity.py @@ -110,7 +110,7 @@ def __init__( warnings.warn( ( "The `join_key` parameter is being deprecated in favor of the `join_keys` parameter. " - "Please switch from using `join_key` to `join_keys`. Feast 0.22 and onwards will not " + "Please switch from using `join_key` to `join_keys`. Feast 0.23 and onwards will not " "support the `join_key` parameter." ), DeprecationWarning, diff --git a/sdk/python/feast/feature_store.py b/sdk/python/feast/feature_store.py index 98d52632609..6932d810de4 100644 --- a/sdk/python/feast/feature_store.py +++ b/sdk/python/feast/feature_store.py @@ -2188,7 +2188,7 @@ def _validate_data_sources(data_sources: List[DataSource]): f"More than one data source with name {case_insensitive_ds_name} found. " f"Please ensure that all data source names are case-insensitively unique. " f"It may be necessary to ignore certain files in your feature repository by using a .feastignore " - f"file. Starting in Feast 0.21, unique names (perhaps inferred from the table name) will be " + f"file. Starting in Feast 0.23, unique names (perhaps inferred from the table name) will be " f"required in data sources to encourage data source discovery" ) else: diff --git a/sdk/python/feast/feature_view.py b/sdk/python/feast/feature_view.py index 65a4914a8f7..4ff7618f2e1 100644 --- a/sdk/python/feast/feature_view.py +++ b/sdk/python/feast/feature_view.py @@ -180,7 +180,7 @@ def __init__( warnings.warn( ( "The option to pass a Duration object to the ttl parameter is being deprecated. " - "Please pass a timedelta object instead. Feast 0.21 and onwards will not support " + "Please pass a timedelta object instead. Feast 0.23 and onwards will not support " "Duration objects." ), DeprecationWarning, @@ -195,7 +195,7 @@ def __init__( ( "The `features` parameter is being deprecated in favor of the `schema` parameter. " "Please switch from using `features` to `schema`. This will also requiring switching " - "feature definitions from using `Feature` to `Field`. Feast 0.21 and onwards will not " + "feature definitions from using `Feature` to `Field`. Feast 0.23 and onwards will not " "support the `features` parameter." ), DeprecationWarning, diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index f66b2066bd5..06e9ce9f624 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -63,7 +63,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for BigQuery sources. " - "It will be removed in Feast 0.21+" + "It will be removed in Feast 0.23+" ), DeprecationWarning, ) @@ -76,7 +76,7 @@ def __init__( else: warnings.warn( ( - f"Starting in Feast 0.21, Feast will require either a name for a data source (if using query) or `table`: {self.query}" + f"Starting in Feast 0.23, Feast will require either a name for a data source (if using query) or `table`: {self.query}" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py index dc92e08a50e..c94b1913598 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py +++ b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py @@ -57,7 +57,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Spark sources." - "It will be removed in Feast 0.21+" + "It will be removed in Feast 0.23+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/file_source.py b/sdk/python/feast/infra/offline_stores/file_source.py index 68c1835cb0f..8b4b08bb87f 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -95,7 +95,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for File sources." - "It will be removed in Feast 0.21+" + "It will be removed in Feast 0.23+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index 93d811998a2..ae9d8bab5c8 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -73,7 +73,7 @@ def __init__( else: warnings.warn( ( - f"Starting in Feast 0.21, Feast will require either a name for a data source (if using query) " + f"Starting in Feast 0.23, Feast will require either a name for a data source (if using query) " f"or `table`: {self.query}" ), DeprecationWarning, @@ -82,7 +82,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Redshift sources." - "It will be removed in Feast 0.21+" + "It will be removed in Feast 0.23+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/snowflake_source.py b/sdk/python/feast/infra/offline_stores/snowflake_source.py index ef3ae52d280..d76131f837b 100644 --- a/sdk/python/feast/infra/offline_stores/snowflake_source.py +++ b/sdk/python/feast/infra/offline_stores/snowflake_source.py @@ -79,7 +79,7 @@ def __init__( else: warnings.warn( ( - f"Starting in Feast 0.21, Feast will require either a name for a data source (if using query) " + f"Starting in Feast 0.23, Feast will require either a name for a data source (if using query) " f"or `table`: {self.query}" ), DeprecationWarning, @@ -89,7 +89,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Snowflake sources." - "It will be removed in Feast 0.21+" + "It will be removed in Feast 0.23+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/on_demand_feature_view.py b/sdk/python/feast/on_demand_feature_view.py index d2cec18e520..244000c6ded 100644 --- a/sdk/python/feast/on_demand_feature_view.py +++ b/sdk/python/feast/on_demand_feature_view.py @@ -127,7 +127,7 @@ def __init__( # noqa: C901 ( "The `features` parameter is being deprecated in favor of the `schema` parameter. " "Please switch from using `features` to `schema`. This will also requiring switching " - "feature definitions from using `Feature` to `Field`. Feast 0.21 and onwards will not " + "feature definitions from using `Feature` to `Field`. Feast 0.23 and onwards will not " "support the `features` parameter." ), DeprecationWarning, @@ -139,7 +139,7 @@ def __init__( # noqa: C901 warnings.warn( ( "The `inputs` parameter is being deprecated. Please use `sources` instead. " - "Feast 0.21 and onwards will not support the `inputs` parameter." + "Feast 0.23 and onwards will not support the `inputs` parameter." ), DeprecationWarning, ) @@ -181,7 +181,7 @@ def __init__( # noqa: C901 ( "The `features` parameter is being deprecated in favor of the `schema` parameter. " "Please switch from using `features` to `schema`. This will also requiring switching " - "feature definitions from using `Feature` to `Field`. Feast 0.21 and onwards will not " + "feature definitions from using `Feature` to `Field`. Feast 0.23 and onwards will not " "support the `features` parameter." ), DeprecationWarning, @@ -202,7 +202,7 @@ def __init__( # noqa: C901 warnings.warn( ( "The `inputs` parameter is being deprecated. Please use `sources` instead. " - "Feast 0.21 and onwards will not support the `inputs` parameter." + "Feast 0.23 and onwards will not support the `inputs` parameter." ), DeprecationWarning, ) @@ -548,7 +548,7 @@ def on_demand_feature_view( ( "The `features` parameter is being deprecated in favor of the `schema` parameter. " "Please switch from using `features` to `schema`. This will also requiring switching " - "feature definitions from using `Feature` to `Field`. Feast 0.21 and onwards will not " + "feature definitions from using `Feature` to `Field`. Feast 0.23 and onwards will not " "support the `features` parameter." ), DeprecationWarning, @@ -560,7 +560,7 @@ def on_demand_feature_view( warnings.warn( ( "The `inputs` parameter is being deprecated. Please use `sources` instead. " - "Feast 0.21 and onwards will not support the `inputs` parameter." + "Feast 0.23 and onwards will not support the `inputs` parameter." ), DeprecationWarning, ) @@ -599,7 +599,7 @@ def on_demand_feature_view( ( "The `features` parameter is being deprecated in favor of the `schema` parameter. " "Please switch from using `features` to `schema`. This will also requiring switching " - "feature definitions from using `Feature` to `Field`. Feast 0.21 and onwards will not " + "feature definitions from using `Feature` to `Field`. Feast 0.23 and onwards will not " "support the `features` parameter." ), DeprecationWarning, @@ -620,7 +620,7 @@ def on_demand_feature_view( warnings.warn( ( "The `inputs` parameter is being deprecated. Please use `sources` instead. " - "Feast 0.21 and onwards will not support the `inputs` parameter." + "Feast 0.23 and onwards will not support the `inputs` parameter." ), DeprecationWarning, ) From c326a89ce1e03d44e099f89ea3fec870b7632dcd Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 11 May 2022 14:36:49 -0700 Subject: [PATCH 3/3] Fix lint Signed-off-by: Kevin Zhang --- .../infra/offline_stores/contrib/spark_offline_store/spark.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py index 87928ee26fb..2a0925d9294 100644 --- a/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py +++ b/sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark.py @@ -35,6 +35,7 @@ # Make sure spark warning doesn't raise more than once. warnings.simplefilter("once", RuntimeWarning) + class SparkOfflineStoreConfig(FeastConfigBaseModel): type: StrictStr = "spark" """ Offline store type selector"""