-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: Request data api update #2488
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
Changes from all commits
7cea469
7b7395c
945e0f8
19158f8
b284d5f
c90a224
a362e9f
f3c9d7a
b442599
af8e98f
b28932d
9ecf9c8
61230c8
340b98a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,6 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
|
|
||
| import enum | ||
| import warnings | ||
| from abc import ABC, abstractmethod | ||
|
|
@@ -144,7 +143,7 @@ def to_proto(self) -> DataSourceProto.KinesisOptions: | |
| DataSourceProto.SourceType.BATCH_SNOWFLAKE: "feast.infra.offline_stores.snowflake_source.SnowflakeSource", | ||
| DataSourceProto.SourceType.STREAM_KAFKA: "feast.data_source.KafkaSource", | ||
| DataSourceProto.SourceType.STREAM_KINESIS: "feast.data_source.KinesisSource", | ||
| DataSourceProto.SourceType.REQUEST_SOURCE: "feast.data_source.RequestDataSource", | ||
| DataSourceProto.SourceType.REQUEST_SOURCE: "feast.data_source.RequestSource", | ||
| DataSourceProto.SourceType.PUSH_SOURCE: "feast.data_source.PushSource", | ||
| } | ||
|
|
||
|
|
@@ -422,9 +421,9 @@ def get_table_query_string(self) -> str: | |
| raise NotImplementedError | ||
|
|
||
|
|
||
| class RequestDataSource(DataSource): | ||
| class RequestSource(DataSource): | ||
| """ | ||
| RequestDataSource that can be used to provide input features for on demand transforms | ||
| RequestSource that can be used to provide input features for on demand transforms | ||
|
|
||
| Args: | ||
| name: Name of the request data source | ||
|
|
@@ -446,7 +445,7 @@ def __init__( | |
| tags: Optional[Dict[str, str]] = None, | ||
| owner: Optional[str] = "", | ||
| ): | ||
| """Creates a RequestDataSource object.""" | ||
| """Creates a RequestSource object.""" | ||
| super().__init__(name=name, description=description, tags=tags, owner=owner) | ||
| self.schema = schema | ||
|
|
||
|
|
@@ -464,7 +463,7 @@ def from_proto(data_source: DataSourceProto): | |
| schema = {} | ||
| for key, val in schema_pb.items(): | ||
| schema[key] = ValueType(val) | ||
| return RequestDataSource( | ||
| return RequestSource( | ||
| name=data_source.name, | ||
| schema=schema, | ||
| description=data_source.description, | ||
|
|
@@ -496,6 +495,15 @@ def source_datatype_to_feast_value_type() -> Callable[[str], ValueType]: | |
| raise NotImplementedError | ||
|
|
||
|
|
||
| class RequestDataSource(RequestSource): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also keep a test for
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup Added. |
||
| def __init__(self, *args, **kwargs): | ||
| warnings.warn( | ||
| "The 'RequestDataSource' class is deprecated and was renamed to RequestSource. Please use RequestSource instead. This class name will be removed in Feast 0.23.", | ||
| DeprecationWarning, | ||
| ) | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
|
|
||
| class KinesisSource(DataSource): | ||
| def validate(self, config: RepoConfig): | ||
| pass | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| from typing import Dict, List, Optional, Type | ||
|
|
||
| from feast.base_feature_view import BaseFeatureView | ||
| from feast.data_source import RequestDataSource | ||
| from feast.data_source import RequestSource | ||
| from feast.feature import Feature | ||
| from feast.feature_view_projection import FeatureViewProjection | ||
| from feast.protos.feast.core.RequestFeatureView_pb2 import ( | ||
|
|
@@ -20,7 +20,7 @@ class RequestFeatureView(BaseFeatureView): | |
|
|
||
| Attributes: | ||
| name: The unique name of the request feature view. | ||
| request_data_source: The request data source that specifies the schema and | ||
| request_source: The request source that specifies the schema and | ||
| features of the request feature view. | ||
| features: The list of features defined as part of this request feature view. | ||
| description: A human-readable description. | ||
|
|
@@ -30,7 +30,7 @@ class RequestFeatureView(BaseFeatureView): | |
| """ | ||
|
|
||
| name: str | ||
| request_data_source: RequestDataSource | ||
| request_source: RequestSource | ||
| features: List[Feature] | ||
| description: str | ||
| tags: Dict[str, str] | ||
|
|
@@ -40,7 +40,7 @@ class RequestFeatureView(BaseFeatureView): | |
| def __init__( | ||
| self, | ||
| name: str, | ||
| request_data_source: RequestDataSource, | ||
| request_data_source: RequestSource, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change field name? also, change to use kwargs? Or is that a different PR?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a different PR, I am not deprecating feature view params here. |
||
| description: str = "", | ||
| tags: Optional[Dict[str, str]] = None, | ||
| owner: str = "", | ||
|
|
@@ -73,7 +73,7 @@ def __init__( | |
| tags=tags, | ||
| owner=owner, | ||
| ) | ||
| self.request_data_source = request_data_source | ||
| self.request_source = request_data_source | ||
|
|
||
| @property | ||
| def proto_class(self) -> Type[RequestFeatureViewProto]: | ||
|
|
@@ -88,7 +88,7 @@ def to_proto(self) -> RequestFeatureViewProto: | |
| """ | ||
| spec = RequestFeatureViewSpec( | ||
| name=self.name, | ||
| request_data_source=self.request_data_source.to_proto(), | ||
| request_data_source=self.request_source.to_proto(), | ||
| description=self.description, | ||
| tags=self.tags, | ||
| owner=self.owner, | ||
|
|
@@ -110,7 +110,7 @@ def from_proto(cls, request_feature_view_proto: RequestFeatureViewProto): | |
|
|
||
| request_feature_view_obj = cls( | ||
| name=request_feature_view_proto.spec.name, | ||
| request_data_source=RequestDataSource.from_proto( | ||
| request_data_source=RequestSource.from_proto( | ||
| request_feature_view_proto.spec.request_data_source | ||
| ), | ||
| description=request_feature_view_proto.spec.description, | ||
|
|
@@ -127,8 +127,6 @@ def from_proto(cls, request_feature_view_proto: RequestFeatureViewProto): | |
| return request_feature_view_obj | ||
|
|
||
| def __copy__(self): | ||
| fv = RequestFeatureView( | ||
| name=self.name, request_data_source=self.request_data_source | ||
| ) | ||
| fv = RequestFeatureView(name=self.name, request_data_source=self.request_source) | ||
| fv.projection = copy.copy(self.projection) | ||
| return fv | ||
Uh oh!
There was an error while loading. Please reload this page.