From 33245bcd8856713ccf597aee5a59930cd026a858 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 10:36:55 -0700 Subject: [PATCH 01/11] fix: Remove date partition column field from datasources that don't support them Signed-off-by: Achal Shah --- .../infra/offline_stores/bigquery_source.py | 18 +++++++++++------ .../spark_offline_store/spark_source.py | 20 ++++++++++++------- .../infra/offline_stores/redshift_source.py | 16 ++++++++++----- .../infra/offline_stores/snowflake_source.py | 19 +++++++++++------- 4 files changed, 48 insertions(+), 25 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index a2831567e6e..6412c42892e 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -20,8 +20,8 @@ def __init__( table: Optional[str] = None, table_ref: Optional[str] = None, created_timestamp_column: Optional[str] = "", + date_partition_column: Optional[str] = None, field_mapping: Optional[Dict[str, str]] = None, - date_partition_column: Optional[str] = "", query: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = "", @@ -37,7 +37,6 @@ def __init__( created_timestamp_column (optional): Timestamp column when row was created, used for deduplicating rows. field_mapping: A dictionary mapping of column names in this data source to feature names in a feature table or view. Only used for feature columns, not entities or timestamp columns. - date_partition_column (optional): Timestamp column used for partitioning. query (optional): SQL query to execute to generate data for this data source. name (optional): Name for the source. Defaults to the table_ref if not specified. description (optional): A human-readable description. @@ -61,6 +60,14 @@ def __init__( table = table_ref self.bigquery_options = BigQueryOptions(table_ref=table, query=query) + if date_partition_column: + warnings.warn( + ( + "The argument 'date_partition_column' is not supported for BigQuery sources." + ), + DeprecationWarning, + ) + # If no name, use the table_ref as the default name _name = name if not _name: @@ -78,10 +85,9 @@ def __init__( super().__init__( _name if _name else "", - event_timestamp_column, - created_timestamp_column, - field_mapping, - date_partition_column, + event_timestamp_column=event_timestamp_column, + created_timestamp_column=created_timestamp_column, + field_mapping=field_mapping, description=description, tags=tags, owner=owner, 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 40197b4c011..3c4b0f2517c 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 @@ -51,12 +51,20 @@ def __init__( _name = table else: raise DataSourceNoNameException() + + if date_partition_column: + warnings.warn( + ( + "The argument 'date_partition_column' is not supported for Spark sources." + ), + DeprecationWarning, + ) + super().__init__( - _name, - event_timestamp_column, - created_timestamp_column, - field_mapping, - date_partition_column, + name=_name, + event_timestamp_column=event_timestamp_column, + created_timestamp_column=created_timestamp_column, + field_mapping=field_mapping, description=description, tags=tags, owner=owner, @@ -130,7 +138,6 @@ def from_proto(data_source: DataSourceProto) -> Any: file_format=spark_options.file_format, event_timestamp_column=data_source.event_timestamp_column, created_timestamp_column=data_source.created_timestamp_column, - date_partition_column=data_source.date_partition_column, description=data_source.description, tags=dict(data_source.tags), owner=data_source.owner, @@ -149,7 +156,6 @@ def to_proto(self) -> DataSourceProto: data_source_proto.event_timestamp_column = self.event_timestamp_column data_source_proto.created_timestamp_column = self.created_timestamp_column - data_source_proto.date_partition_column = self.date_partition_column return data_source_proto diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index b2fa143a860..da380e55ba8 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -20,8 +20,8 @@ def __init__( table: Optional[str] = None, schema: Optional[str] = None, created_timestamp_column: Optional[str] = "", + date_partition_column: Optional[str] = None, field_mapping: Optional[Dict[str, str]] = None, - date_partition_column: Optional[str] = "", query: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = "", @@ -68,13 +68,19 @@ def __init__( ), DeprecationWarning, ) + if date_partition_column: + warnings.warn( + ( + "The argument 'date_partition_column' is not supported for Redshift sources." + ), + DeprecationWarning, + ) super().__init__( _name if _name else "", - event_timestamp_column, - created_timestamp_column, - field_mapping, - date_partition_column, + event_timestamp_column=event_timestamp_column, + created_timestamp_column=created_timestamp_column, + field_mapping=field_mapping, description=description, tags=tags, owner=owner, diff --git a/sdk/python/feast/infra/offline_stores/snowflake_source.py b/sdk/python/feast/infra/offline_stores/snowflake_source.py index 40868ef64d2..2b6a43ffafe 100644 --- a/sdk/python/feast/infra/offline_stores/snowflake_source.py +++ b/sdk/python/feast/infra/offline_stores/snowflake_source.py @@ -20,9 +20,9 @@ def __init__( table: Optional[str] = None, query: Optional[str] = None, event_timestamp_column: Optional[str] = "", + date_partition_column: Optional[str] = None, created_timestamp_column: Optional[str] = "", field_mapping: Optional[Dict[str, str]] = None, - date_partition_column: Optional[str] = "", name: Optional[str] = None, description: Optional[str] = "", tags: Optional[Dict[str, str]] = None, @@ -72,12 +72,19 @@ def __init__( DeprecationWarning, ) + if date_partition_column: + warnings.warn( + ( + "The argument 'date_partition_column' is not supported for Snowflake sources." + ), + DeprecationWarning, + ) + super().__init__( _name if _name else "", - event_timestamp_column, - created_timestamp_column, - field_mapping, - date_partition_column, + event_timestamp_column=event_timestamp_column, + created_timestamp_column=created_timestamp_column, + field_mapping=field_mapping, description=description, tags=tags, owner=owner, @@ -101,7 +108,6 @@ def from_proto(data_source: DataSourceProto): table=data_source.snowflake_options.table, event_timestamp_column=data_source.event_timestamp_column, created_timestamp_column=data_source.created_timestamp_column, - date_partition_column=data_source.date_partition_column, query=data_source.snowflake_options.query, description=data_source.description, tags=dict(data_source.tags), @@ -170,7 +176,6 @@ def to_proto(self) -> DataSourceProto: data_source_proto.event_timestamp_column = self.event_timestamp_column data_source_proto.created_timestamp_column = self.created_timestamp_column - data_source_proto.date_partition_column = self.date_partition_column return data_source_proto From 319b073be187c0c89dd403d171dc5e1aa69235eb Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 11:04:14 -0700 Subject: [PATCH 02/11] remove for file sources as well Signed-off-by: Achal Shah --- .../feast/infra/offline_stores/file_source.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/file_source.py b/sdk/python/feast/infra/offline_stores/file_source.py index ebeb0e28fdf..7389e17bd9a 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -66,12 +66,19 @@ def __init__( s3_endpoint_override=s3_endpoint_override, ) + if date_partition_column: + warnings.warn( + ( + "The argument 'date_partition_column' is not supported for File sources." + ), + DeprecationWarning, + ) + super().__init__( - name if name else path, - event_timestamp_column, - created_timestamp_column, - field_mapping, - date_partition_column, + name=name if name else path, + event_timestamp_column=event_timestamp_column, + created_timestamp_column=created_timestamp_column, + field_mapping=field_mapping, description=description, tags=tags, owner=owner, @@ -114,7 +121,6 @@ def from_proto(data_source: DataSourceProto): path=data_source.file_options.uri, event_timestamp_column=data_source.event_timestamp_column, created_timestamp_column=data_source.created_timestamp_column, - date_partition_column=data_source.date_partition_column, s3_endpoint_override=data_source.file_options.s3_endpoint_override, description=data_source.description, tags=dict(data_source.tags), @@ -134,7 +140,6 @@ def to_proto(self) -> DataSourceProto: data_source_proto.event_timestamp_column = self.event_timestamp_column data_source_proto.created_timestamp_column = self.created_timestamp_column - data_source_proto.date_partition_column = self.date_partition_column return data_source_proto From d3aef10a96ce266b0b459cf39886ee1bc2f6eae9 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 11:11:25 -0700 Subject: [PATCH 03/11] remove other references Signed-off-by: Achal Shah --- .../integration/feature_repos/universal/data_sources/bigquery.py | 1 - .../integration/feature_repos/universal/data_sources/file.py | 1 - .../integration/feature_repos/universal/data_sources/redshift.py | 1 - .../feature_repos/universal/data_sources/snowflake.py | 1 - .../universal/data_sources/spark_data_source_creator.py | 1 - sdk/python/tests/integration/registration/test_registry.py | 1 - 6 files changed, 6 deletions(-) diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py index e0ac2050ea5..3b8fd9410ad 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/bigquery.py @@ -77,7 +77,6 @@ def create_data_source( table_ref=destination_name, event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", field_mapping=field_mapping or {"ts_1": "ts"}, ) diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py index baa3db6afc1..4f451cac515 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py @@ -48,7 +48,6 @@ def create_data_source( path=f"{f.name}", event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", field_mapping=field_mapping or {"ts_1": "ts"}, ) diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py index 49b31263cf9..9cc45091ce0 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py @@ -63,7 +63,6 @@ def create_data_source( table=destination_name, event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", field_mapping=field_mapping or {"ts_1": "ts"}, ) diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/snowflake.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/snowflake.py index f76656f5b71..f88e9b595c4 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/snowflake.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/snowflake.py @@ -55,7 +55,6 @@ def create_data_source( table=destination_name, event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", field_mapping=field_mapping or {"ts_1": "ts"}, ) diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/spark_data_source_creator.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/spark_data_source_creator.py index 4284c3cf4c4..ecefba7acb7 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/spark_data_source_creator.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/spark_data_source_creator.py @@ -95,7 +95,6 @@ def create_data_source( table=destination_name, event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", # maps certain column names to other names field_mapping=field_mapping or {"ts_1": "ts"}, ) diff --git a/sdk/python/tests/integration/registration/test_registry.py b/sdk/python/tests/integration/registration/test_registry.py index fb68770db80..5f39cdbc107 100644 --- a/sdk/python/tests/integration/registration/test_registry.py +++ b/sdk/python/tests/integration/registration/test_registry.py @@ -169,7 +169,6 @@ def test_apply_feature_view_success(test_registry): path="file://feast/*", event_timestamp_column="ts_col", created_timestamp_column="timestamp", - date_partition_column="date_partition_col", ) fv1 = FeatureView( From 462c2106dd6ed87d7e31a4fa4f553f487f6d2c13 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:30:16 -0700 Subject: [PATCH 04/11] remove other references Signed-off-by: Achal Shah --- .../feast/infra/offline_stores/bigquery_source.py | 13 +++++++------ .../feature_repos/universal/data_sources/file.py | 1 - .../tests/integration/registration/test_registry.py | 3 --- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index 6412c42892e..f4bdd0fc2aa 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -14,14 +14,18 @@ class BigQuerySource(DataSource): + def __hash__(self): + return super().__hash__() + + # Note: Python requires redefining hash in child classes that override __eq__ def __init__( self, event_timestamp_column: Optional[str] = "", table: Optional[str] = None, table_ref: Optional[str] = None, created_timestamp_column: Optional[str] = "", - date_partition_column: Optional[str] = None, field_mapping: Optional[Dict[str, str]] = None, + date_partition_column: Optional[str] = None, query: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = "", @@ -63,7 +67,8 @@ def __init__( if date_partition_column: warnings.warn( ( - "The argument 'date_partition_column' is not supported for BigQuery sources." + "The argument 'date_partition_column' is not supported for BigQuery sources. " + "It will be removed in Feast 0.21+" ), DeprecationWarning, ) @@ -93,10 +98,6 @@ def __init__( owner=owner, ) - # Note: Python requires redefining hash in child classes that override __eq__ - def __hash__(self): - return super().__hash__() - def __eq__(self, other): if not isinstance(other, BigQuerySource): raise TypeError( diff --git a/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py b/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py index 4f451cac515..afc974b8431 100644 --- a/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py +++ b/sdk/python/tests/integration/feature_repos/universal/data_sources/file.py @@ -129,7 +129,6 @@ def create_data_source( path=f"s3://{self.bucket}/{filename}", event_timestamp_column=event_timestamp_column, created_timestamp_column=created_timestamp_column, - date_partition_column="", field_mapping=field_mapping or {"ts_1": "ts"}, s3_endpoint_override=f"http://{host}:{port}", ) diff --git a/sdk/python/tests/integration/registration/test_registry.py b/sdk/python/tests/integration/registration/test_registry.py index 5f39cdbc107..88369ba76ba 100644 --- a/sdk/python/tests/integration/registration/test_registry.py +++ b/sdk/python/tests/integration/registration/test_registry.py @@ -242,7 +242,6 @@ def test_modify_feature_views_success(test_registry): path="file://feast/*", event_timestamp_column="ts_col", created_timestamp_column="timestamp", - date_partition_column="date_partition_col", ) request_source = RequestDataSource( @@ -363,7 +362,6 @@ def test_apply_feature_view_integration(test_registry): path="file://feast/*", event_timestamp_column="ts_col", created_timestamp_column="timestamp", - date_partition_column="date_partition_col", ) fv1 = FeatureView( @@ -439,7 +437,6 @@ def test_apply_data_source(test_registry: Registry): path="file://feast/*", event_timestamp_column="ts_col", created_timestamp_column="timestamp", - date_partition_column="date_partition_col", ) fv1 = FeatureView( From d655ada0c1bb5f459c5e918275b4f717349a4a79 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:35:52 -0700 Subject: [PATCH 05/11] reference to removal Signed-off-by: Achal Shah --- .../offline_stores/contrib/spark_offline_store/spark_source.py | 1 + sdk/python/feast/infra/offline_stores/file_source.py | 1 + sdk/python/feast/infra/offline_stores/snowflake_source.py | 1 + 3 files changed, 3 insertions(+) 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 3c4b0f2517c..37f33bb20e5 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 @@ -56,6 +56,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Spark sources." + "It will be removed in Feast 0.21+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/file_source.py b/sdk/python/feast/infra/offline_stores/file_source.py index 7389e17bd9a..64d8be06afe 100644 --- a/sdk/python/feast/infra/offline_stores/file_source.py +++ b/sdk/python/feast/infra/offline_stores/file_source.py @@ -70,6 +70,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for File sources." + "It will be removed in Feast 0.21+" ), DeprecationWarning, ) diff --git a/sdk/python/feast/infra/offline_stores/snowflake_source.py b/sdk/python/feast/infra/offline_stores/snowflake_source.py index 2b6a43ffafe..dbb4b7aab92 100644 --- a/sdk/python/feast/infra/offline_stores/snowflake_source.py +++ b/sdk/python/feast/infra/offline_stores/snowflake_source.py @@ -76,6 +76,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Snowflake sources." + "It will be removed in Feast 0.21+" ), DeprecationWarning, ) From ed96a2b0528e38711e369352318551bed16d1d79 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:39:31 -0700 Subject: [PATCH 06/11] reference to removal Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/redshift_source.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index da380e55ba8..8742d9bbb3b 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -72,6 +72,7 @@ def __init__( warnings.warn( ( "The argument 'date_partition_column' is not supported for Redshift sources." + "It will be removed in Feast 0.21+" ), DeprecationWarning, ) From 06f81eda2fb3f9ee253e24086c2f1bd277d8066b Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:41:08 -0700 Subject: [PATCH 07/11] reorder Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/redshift_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index 8742d9bbb3b..38abc0c0a6c 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -20,8 +20,8 @@ def __init__( table: Optional[str] = None, schema: Optional[str] = None, created_timestamp_column: Optional[str] = "", - date_partition_column: Optional[str] = None, field_mapping: Optional[Dict[str, str]] = None, + date_partition_column: Optional[str] = None, query: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = "", From 0b7e26e4e2a4bf8f355240c145e42a841eaa766a Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:42:34 -0700 Subject: [PATCH 08/11] remove more: Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/redshift_source.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index 38abc0c0a6c..1e4d3b1c001 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -104,7 +104,6 @@ def from_proto(data_source: DataSourceProto): schema=data_source.redshift_options.schema, event_timestamp_column=data_source.event_timestamp_column, created_timestamp_column=data_source.created_timestamp_column, - date_partition_column=data_source.date_partition_column, query=data_source.redshift_options.query, description=data_source.description, tags=dict(data_source.tags), @@ -167,7 +166,6 @@ def to_proto(self) -> DataSourceProto: data_source_proto.event_timestamp_column = self.event_timestamp_column data_source_proto.created_timestamp_column = self.created_timestamp_column - data_source_proto.date_partition_column = self.date_partition_column return data_source_proto From 300f76ba3746e5daefe55a2a71ae0abaa8715cf0 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:44:46 -0700 Subject: [PATCH 09/11] docs Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/bigquery_source.py | 1 + sdk/python/feast/infra/offline_stores/redshift_source.py | 2 +- sdk/python/feast/infra/offline_stores/snowflake_source.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index f4bdd0fc2aa..0c54d847ce2 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -41,6 +41,7 @@ def __init__( created_timestamp_column (optional): Timestamp column when row was created, used for deduplicating rows. field_mapping: A dictionary mapping of column names in this data source to feature names in a feature table or view. Only used for feature columns, not entities or timestamp columns. + date_partition_column (deprecated): Timestamp column used for partitioning. query (optional): SQL query to execute to generate data for this data source. name (optional): Name for the source. Defaults to the table_ref if not specified. description (optional): A human-readable description. diff --git a/sdk/python/feast/infra/offline_stores/redshift_source.py b/sdk/python/feast/infra/offline_stores/redshift_source.py index 1e4d3b1c001..e1ec08378e0 100644 --- a/sdk/python/feast/infra/offline_stores/redshift_source.py +++ b/sdk/python/feast/infra/offline_stores/redshift_source.py @@ -40,7 +40,7 @@ def __init__( row was created, used for deduplicating rows. field_mapping (optional): A dictionary mapping of column names in this data source to column names in a feature table or view. - date_partition_column (optional): Timestamp column used for partitioning. + date_partition_column (deprecated): Timestamp column used for partitioning. query (optional): The query to be executed to obtain the features. name (optional): Name for the source. Defaults to the table_ref if not specified. description (optional): A human-readable description. diff --git a/sdk/python/feast/infra/offline_stores/snowflake_source.py b/sdk/python/feast/infra/offline_stores/snowflake_source.py index dbb4b7aab92..d335f33ddad 100644 --- a/sdk/python/feast/infra/offline_stores/snowflake_source.py +++ b/sdk/python/feast/infra/offline_stores/snowflake_source.py @@ -42,7 +42,7 @@ def __init__( row was created, used for deduplicating rows. field_mapping (optional): A dictionary mapping of column names in this data source to column names in a feature table or view. - date_partition_column (optional): Timestamp column used for partitioning. + date_partition_column (deprecated): Timestamp column used for partitioning. name (optional): Name for the source. Defaults to the table if not specified. description (optional): A human-readable description. tags (optional): A dictionary of key-value pairs to store arbitrary metadata. From 2da035e99ee50960f2b659d8a6311168543c7799 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 13:51:17 -0700 Subject: [PATCH 10/11] comment Signed-off-by: Achal Shah --- sdk/python/feast/infra/offline_stores/bigquery_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index 0c54d847ce2..87c33bdf6df 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -14,10 +14,10 @@ class BigQuerySource(DataSource): + # Note: Python requires redefining hash in child classes that override __eq__ def __hash__(self): return super().__hash__() - # Note: Python requires redefining hash in child classes that override __eq__ def __init__( self, event_timestamp_column: Optional[str] = "", From c2dbd7b6e89e3b46ae86ec474ef53444f18b7739 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 1 Apr 2022 14:03:54 -0700 Subject: [PATCH 11/11] cr Signed-off-by: Achal Shah --- .../feast/infra/offline_stores/bigquery_source.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index 87c33bdf6df..d36da8f342f 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -14,10 +14,6 @@ class BigQuerySource(DataSource): - # Note: Python requires redefining hash in child classes that override __eq__ - def __hash__(self): - return super().__hash__() - def __init__( self, event_timestamp_column: Optional[str] = "", @@ -99,6 +95,10 @@ def __init__( owner=owner, ) + # Note: Python requires redefining hash in child classes that override __eq__ + def __hash__(self): + return super().__hash__() + def __eq__(self, other): if not isinstance(other, BigQuerySource): raise TypeError( @@ -136,7 +136,6 @@ def from_proto(data_source: DataSourceProto): table_ref=data_source.bigquery_options.table_ref, event_timestamp_column=data_source.event_timestamp_column, created_timestamp_column=data_source.created_timestamp_column, - date_partition_column=data_source.date_partition_column, query=data_source.bigquery_options.query, description=data_source.description, tags=dict(data_source.tags), @@ -156,7 +155,6 @@ def to_proto(self) -> DataSourceProto: data_source_proto.event_timestamp_column = self.event_timestamp_column data_source_proto.created_timestamp_column = self.created_timestamp_column - data_source_proto.date_partition_column = self.date_partition_column return data_source_proto