diff --git a/sdk/python/feast/infra/registry/sql.py b/sdk/python/feast/infra/registry/sql.py index da753e9da8..ba822f816f 100644 --- a/sdk/python/feast/infra/registry/sql.py +++ b/sdk/python/feast/infra/registry/sql.py @@ -655,8 +655,7 @@ def apply_user_metadata( ) conn.execute(update_stmt) else: - raise FeatureViewNotFoundException( - feature_view.name, project=project) + raise FeatureViewNotFoundException(feature_view.name, project=project) def _infer_fv_table(self, feature_view): if isinstance(feature_view, StreamFeatureView): @@ -666,8 +665,7 @@ def _infer_fv_table(self, feature_view): elif isinstance(feature_view, OnDemandFeatureView): table = on_demand_feature_views else: - raise ValueError( - f"Unexpected feature view type: {type(feature_view)}") + raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return table def _infer_fv_classes(self, feature_view): @@ -678,8 +676,7 @@ def _infer_fv_classes(self, feature_view): elif isinstance(feature_view, OnDemandFeatureView): python_class, proto_class = OnDemandFeatureView, OnDemandFeatureViewProto else: - raise ValueError( - f"Unexpected feature view type: {type(feature_view)}") + raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return python_class, proto_class def get_user_metadata( @@ -689,14 +686,12 @@ def get_user_metadata( name = feature_view.name with self.engine.begin() as conn: - stmt = select(table).where( - getattr(table.c, "feature_view_name") == name) + stmt = select(table).where(getattr(table.c, "feature_view_name") == name) row = conn.execute(stmt).first() if row: return row._mapping["user_metadata"] else: - raise FeatureViewNotFoundException( - feature_view.name, project=project) + raise FeatureViewNotFoundException(feature_view.name, project=project) def proto(self) -> RegistryProto: r = RegistryProto() @@ -727,8 +722,7 @@ def proto(self) -> RegistryProto: # This is suuuper jank. Because of https://github.com/feast-dev/feast/issues/2783, # the registry proto only has a single infra field, which we're currently setting as the "last" project. r.infra.CopyFrom(self.get_infra(project).to_proto()) - last_updated_timestamps.append( - self._get_last_updated_metadata(project)) + last_updated_timestamps.append(self._get_last_updated_metadata(project)) if last_updated_timestamps: r.last_updated.FromDatetime(max(last_updated_timestamps)) @@ -757,8 +751,7 @@ def _apply_object( update_datetime = _utc_now() update_time = int(update_datetime.timestamp()) stmt = select(table).where( - getattr( - table.c, id_field_name) == name, table.c.project_id == project + getattr(table.c, id_field_name) == name, table.c.project_id == project ) row = conn.execute(stmt).first() if hasattr(obj, "last_updated_timestamp"): @@ -804,8 +797,7 @@ def _apply_object( if hasattr(obj_proto, "meta") and hasattr( obj_proto.meta, "created_timestamp" ): - obj_proto.meta.created_timestamp.FromDatetime( - update_datetime) + obj_proto.meta.created_timestamp.FromDatetime(update_datetime) values = { id_field_name: name, @@ -851,8 +843,7 @@ def _delete_object( ): with self.engine.begin() as conn: stmt = delete(table).where( - getattr( - table.c, id_field_name) == name, table.c.project_id == project + getattr(table.c, id_field_name) == name, table.c.project_id == project ) rows = conn.execute(stmt) if rows.rowcount < 1 and not_found_exception: @@ -876,8 +867,7 @@ def _get_object( with self.engine.begin() as conn: stmt = select(table).where( - getattr( - table.c, id_field_name) == name, table.c.project_id == project + getattr(table.c, id_field_name) == name, table.c.project_id == project ) row = conn.execute(stmt).first() if row: