Skip to content

Commit

Permalink
Undo feast-dev#1905 changes
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals committed Sep 29, 2021
1 parent 0dd100b commit cb0bb8c
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 36 deletions.
6 changes: 0 additions & 6 deletions sdk/python/feast/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
from datetime import datetime
from typing import Dict, Optional

import yaml
from google.protobuf import json_format
from google.protobuf.json_format import MessageToDict, MessageToJson

from feast.importer import get_calling_file_name
from feast.loaders import yaml as feast_yaml
from feast.protos.feast.core.Entity_pb2 import Entity as EntityV2Proto
from feast.protos.feast.core.Entity_pb2 import EntityMeta as EntityMetaProto
Expand Down Expand Up @@ -50,8 +48,6 @@ class Entity:
_created_timestamp: Optional[datetime]
_last_updated_timestamp: Optional[datetime]

defined_in: str

@log_exceptions
def __init__(
self,
Expand All @@ -78,8 +74,6 @@ def __init__(
self._created_timestamp: Optional[datetime] = None
self._last_updated_timestamp: Optional[datetime] = None

self.defined_in = get_calling_file_name(inspect.stack())

def __hash__(self) -> int:
return hash(self.name)

Expand Down
6 changes: 0 additions & 6 deletions sdk/python/feast/feature_service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import inspect
from datetime import datetime
from typing import Dict, List, Optional, Union

Expand All @@ -7,7 +6,6 @@
from feast.feature_table import FeatureTable
from feast.feature_view import FeatureView
from feast.feature_view_projection import FeatureViewProjection
from feast.importer import get_calling_file_name
from feast.on_demand_feature_view import OnDemandFeatureView
from feast.protos.feast.core.FeatureService_pb2 import (
FeatureService as FeatureServiceProto,
Expand Down Expand Up @@ -39,8 +37,6 @@ class FeatureService:
created_timestamp: Optional[datetime] = None
last_updated_timestamp: Optional[datetime] = None

defined_in: str

@log_exceptions
def __init__(
self,
Expand Down Expand Up @@ -75,8 +71,6 @@ def __init__(
self.created_timestamp = None
self.last_updated_timestamp = None

self.defined_in = get_calling_file_name(inspect.stack())

def __repr__(self):
items = (f"{k} = {v}" for k, v in self.__dict__.items())
return f"<{self.__class__.__name__}({', '.join(items)})>"
Expand Down
4 changes: 0 additions & 4 deletions sdk/python/feast/feature_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
from typing import Dict, List, MutableMapping, Optional, Union

import yaml
Expand All @@ -22,7 +21,6 @@

from feast.data_source import DataSource, KafkaSource, KinesisSource
from feast.feature import Feature
from feast.importer import get_calling_file_name
from feast.loaders import yaml as feast_yaml
from feast.protos.feast.core.FeatureTable_pb2 import FeatureTable as FeatureTableProto
from feast.protos.feast.core.FeatureTable_pb2 import (
Expand Down Expand Up @@ -67,8 +65,6 @@ def __init__(
self._created_timestamp: Optional[Timestamp] = None
self._last_updated_timestamp: Optional[Timestamp] = None

self.defined_in = get_calling_file_name(inspect.stack())

def __str__(self):
return str(MessageToJson(self.to_proto()))

Expand Down
6 changes: 0 additions & 6 deletions sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
import re
import warnings
from datetime import datetime, timedelta
Expand All @@ -25,7 +24,6 @@
from feast.errors import RegistryInferenceFailure
from feast.feature import Feature
from feast.feature_view_projection import FeatureViewProjection
from feast.importer import get_calling_file_name
from feast.protos.feast.core.FeatureView_pb2 import FeatureView as FeatureViewProto
from feast.protos.feast.core.FeatureView_pb2 import (
FeatureViewMeta as FeatureViewMetaProto,
Expand Down Expand Up @@ -81,8 +79,6 @@ class FeatureView:
last_updated_timestamp: Optional[datetime] = None
materialization_intervals: List[Tuple[datetime, datetime]]

defined_in: str

@log_exceptions
def __init__(
self,
Expand Down Expand Up @@ -145,8 +141,6 @@ def __init__(
self.created_timestamp: Optional[datetime] = None
self.last_updated_timestamp: Optional[datetime] = None

self.defined_in = get_calling_file_name(inspect.stack())

def __repr__(self):
items = (f"{k} = {v}" for k, v in self.__dict__.items())
return f"<{self.__class__.__name__}({', '.join(items)})>"
Expand Down
8 changes: 0 additions & 8 deletions sdk/python/feast/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
from feast import errors


def get_calling_file_name(stack) -> str:
# Get two levels up from current, to ignore usage.py
previous_stack_frame = stack[1]
if "feast/usage.py" in previous_stack_frame.filename:
previous_stack_frame = stack[2]
return previous_stack_frame.filename


def get_class_from_type(module_name: str, class_name: str, class_type: str):
if not class_name.endswith(class_type):
raise errors.FeastClassInvalidName(class_name, class_type)
Expand Down
6 changes: 0 additions & 6 deletions sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import functools
import inspect
from types import MethodType
from typing import Dict, List, Union, cast

Expand All @@ -12,7 +11,6 @@
from feast.feature import Feature
from feast.feature_view import FeatureView
from feast.feature_view_projection import FeatureViewProjection
from feast.importer import get_calling_file_name
from feast.protos.feast.core.OnDemandFeatureView_pb2 import (
OnDemandFeatureView as OnDemandFeatureViewProto,
)
Expand Down Expand Up @@ -48,8 +46,6 @@ class OnDemandFeatureView:
inputs: Dict[str, Union[FeatureView, RequestDataSource]]
udf: MethodType

defined_in: str

@log_exceptions
def __init__(
self,
Expand All @@ -67,8 +63,6 @@ def __init__(
self.inputs = inputs
self.udf = udf

self.defined_in = get_calling_file_name(inspect.stack())

def to_proto(self) -> OnDemandFeatureViewProto:
"""
Converts an on demand feature view object to its protobuf representation.
Expand Down

0 comments on commit cb0bb8c

Please sign in to comment.