Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Punt deprecation warnings and clean up some warnings. #2670

Merged
merged 3 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/diff/registry_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/offline_stores/bigquery_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/offline_stores/file_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/offline_stores/offline_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
if TYPE_CHECKING:
from feast.saved_dataset import ValidationReference

warnings.simplefilter("once", RuntimeWarning)


class RetrievalMetadata:
min_event_timestamp: Optional[datetime]
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/offline_stores/redshift_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/offline_stores/snowflake_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down
16 changes: 8 additions & 8 deletions sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down