Skip to content

Commit

Permalink
Remove logic duplicated by parent class
Browse files Browse the repository at this point in the history
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
  • Loading branch information
judahrand committed Feb 2, 2022
1 parent b90e125 commit 5de401d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 2 additions & 2 deletions sdk/python/feast/base_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
class BaseFeatureView(ABC):
"""A FeatureView defines a logical grouping of features to be served."""

created_timestamp: Optional[datetime] = None
last_updated_timestamp: Optional[datetime] = None
created_timestamp: Optional[datetime]
last_updated_timestamp: Optional[datetime]

@abstractmethod
def __init__(self, name: str, features: List[Feature]):
Expand Down
7 changes: 1 addition & 6 deletions sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ class FeatureView(BaseFeatureView):
online: bool
input: DataSource
batch_source: DataSource
stream_source: Optional[DataSource] = None
created_timestamp: Optional[datetime] = None
last_updated_timestamp: Optional[datetime] = None
stream_source: Optional[DataSource]
materialization_intervals: List[Tuple[datetime, datetime]]

@log_exceptions
Expand Down Expand Up @@ -137,9 +135,6 @@ def __init__(

self.materialization_intervals = []

self.created_timestamp: Optional[datetime] = None
self.last_updated_timestamp: Optional[datetime] = None

# Note: Python requires redefining hash in child classes that override __eq__
def __hash__(self):
return super().__hash__()
Expand Down
7 changes: 1 addition & 6 deletions sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import copy
import functools
from datetime import datetime
from types import MethodType
from typing import Dict, List, Optional, Type, Union
from typing import Dict, List, Type, Union

import dill
import pandas as pd
Expand Down Expand Up @@ -48,8 +47,6 @@ class OnDemandFeatureView(BaseFeatureView):
input_feature_view_projections: Dict[str, FeatureViewProjection]
input_request_data_sources: Dict[str, RequestDataSource]
udf: MethodType
created_timestamp: Optional[datetime] = None
last_updated_timestamp: Optional[datetime] = None

@log_exceptions
def __init__(
Expand All @@ -74,8 +71,6 @@ def __init__(
self.input_feature_view_projections[input_ref] = odfv_input.projection

self.udf = udf
self.created_timestamp: Optional[datetime] = None
self.last_updated_timestamp: Optional[datetime] = None

@property
def proto_class(self) -> Type[OnDemandFeatureViewProto]:
Expand Down

0 comments on commit 5de401d

Please sign in to comment.