Skip to content

Commit

Permalink
fix hasattr
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals committed Aug 5, 2022
1 parent 7e85fba commit d9111ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sdk/python/feast/infra/registry_stores/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def _apply_object(
):
self._maybe_init_project_metadata(project)

name = name or obj.name if hasattr(obj, name) else None
name = name or obj.name if hasattr(obj, "name") else None
assert name, f"name needs to be provided for {obj}"
with self.engine.connect() as conn:
update_datetime = datetime.utcnow()
Expand Down Expand Up @@ -759,7 +759,12 @@ def _maybe_init_project_metadata(self, project):
usage.set_current_project_uuid(new_project_uuid)

def _delete_object(
self, table: Table, name: str, project: str, id_field_name: str, not_found_exception: Optional[Callable]
self,
table: Table,
name: str,
project: str,
id_field_name: str,
not_found_exception: Optional[Callable],
):
with self.engine.connect() as conn:
stmt = delete(table).where(
Expand Down

0 comments on commit d9111ef

Please sign in to comment.