Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
adchia committed Mar 29, 2022
1 parent e17973f commit 0fe2df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions sdk/python/feast/diff/registry_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ 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]]:
existing_obj_names = {e.name for e in existing_objs}
desired_objs = list(desired_objs)
existing_objs = list(existing_objs)
desired_obj_names = {e.name for e in desired_objs}
# 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]
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/integration/registration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_universal_cli(environment: Environment):
["data-sources", "describe", "customer_profile_source"], cwd=repo_path,
)
assertpy.assert_that(result.returncode).is_equal_to(0)
assertpy.assert_that(fs.list_data_sources()).is_length(5)
assertpy.assert_that(fs.list_data_sources()).is_length(4)

# entity & feature view describe commands should fail when objects don't exist
result = runner.run(["entities", "describe", "foo"], cwd=repo_path)
Expand Down

0 comments on commit 0fe2df8

Please sign in to comment.