Skip to content
Merged
Prev Previous commit
fix
Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
adchia committed Mar 29, 2022
commit f854de47a76aec13df470e59e91d7e0f01c595bd
3 changes: 0 additions & 3 deletions sdk/python/feast/base_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def __repr__(self):
def __str__(self):
return str(MessageToJson(self.to_proto()))

def __lt__(self, other):
return self.name < other.name

def __hash__(self):
return hash((id(self), self.name))

Expand Down
3 changes: 0 additions & 3 deletions sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ def __hash__(self):
def __str__(self):
return str(MessageToJson(self.to_proto()))

def __lt__(self, other):
return str(self) < str(other)

def __eq__(self, other):
if not isinstance(other, DataSource):
raise TypeError("Comparisons should only involve DataSource class objects.")
Expand Down
18 changes: 9 additions & 9 deletions sdk/python/feast/diff/registry_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ def to_string(self):

def tag_objects_for_keep_delete_update_add(
existing_objs: Iterable[FeastObject], desired_objs: Iterable[FeastObject]
) -> Tuple[List[FeastObject], List[FeastObject], List[FeastObject], List[FeastObject]]:
) -> Tuple[Set[FeastObject], Set[FeastObject], Set[FeastObject], Set[FeastObject]]:
# TODO(adchia): Remove the "if X.name" condition when data sources are forced to have names
existing_obj_names = {e.name for e in existing_objs if e.name}
desired_objs = [obj for obj in desired_objs if obj.name]
existing_objs = [obj for obj in existing_objs if obj.name]
desired_obj_names = {e.name for e in desired_objs if e.name}

objs_to_add = [e for e in desired_objs if e.name not in existing_obj_names]
objs_to_update = [e for e in desired_objs if e.name in existing_obj_names]
objs_to_keep = [e for e in existing_objs if e.name in desired_obj_names]
objs_to_delete = [e for e in existing_objs if e.name not in desired_obj_names]
objs_to_add = {e for e in desired_objs if e.name not in existing_obj_names}
objs_to_update = {e for e in desired_objs if e.name in existing_obj_names}
objs_to_keep = {e for e in existing_objs if e.name in desired_obj_names}
objs_to_delete = {e for e in existing_objs if e.name not in desired_obj_names}

return objs_to_keep, objs_to_delete, objs_to_update, objs_to_add

Expand Down Expand Up @@ -155,10 +155,10 @@ def diff_registry_objects(
def extract_objects_for_keep_delete_update_add(
registry: Registry, current_project: str, desired_repo_contents: RepoContents,
) -> Tuple[
Dict[FeastObjectType, List[FeastObject]],
Dict[FeastObjectType, List[FeastObject]],
Dict[FeastObjectType, List[FeastObject]],
Dict[FeastObjectType, List[FeastObject]],
Dict[FeastObjectType, Set[FeastObject]],
Dict[FeastObjectType, Set[FeastObject]],
Dict[FeastObjectType, Set[FeastObject]],
Dict[FeastObjectType, Set[FeastObject]],
]:
"""
Returns the objects in the registry that must be modified to achieve the desired repo state.
Expand Down
3 changes: 0 additions & 3 deletions sdk/python/feast/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ def __init__(
def __hash__(self) -> int:
return hash((id(self), self.name))

def __lt__(self, other):
return self.name < other.name

def __eq__(self, other):
if not isinstance(other, Entity):
raise TypeError("Comparisons should only involve Entity class objects.")
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 @@ -675,7 +675,7 @@ def apply(
for v in odfv.input_request_data_sources.values():
data_sources_set_to_update.add(v)

data_sources_to_update = sorted(list(data_sources_set_to_update))
data_sources_to_update = list(data_sources_set_to_update)

# Validate all feature views and make inferences.
self._validate_all_feature_views(
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/go_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from subprocess import Popen
from typing import Any, Dict, List, Optional, Union

import grpc
from tenacity import retry, stop_after_attempt, stop_after_delay, wait_exponential

import feast
import grpc
from feast.errors import FeatureNameCollisionError, InvalidFeaturesParameterType
from feast.feature_service import FeatureService
from feast.flags_helper import is_test
Expand Down
4 changes: 1 addition & 3 deletions sdk/python/feast/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def get_objects_from_registry(
registry: "Registry", project: str
) -> Dict["FeastObjectType", List[Any]]:
return {
FeastObjectType.DATA_SOURCE: sorted(
registry.list_data_sources(project=project)
),
FeastObjectType.DATA_SOURCE: registry.list_data_sources(project=project),
FeastObjectType.ENTITY: registry.list_entities(project=project),
FeastObjectType.FEATURE_VIEW: registry.list_feature_views(project=project),
FeastObjectType.ON_DEMAND_FEATURE_VIEW: registry.list_on_demand_feature_views(
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/transformation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import sys
from concurrent import futures

import grpc
import pyarrow as pa
from grpc_reflection.v1alpha import reflection

import grpc
from feast.errors import OnDemandFeatureViewNotFoundException
from feast.feature_store import FeatureStore
from feast.protos.feast.serving.TransformationService_pb2 import (
Expand Down