Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/java/feast/core/grpc/CoreServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void createProject(
responseObserver.onNext(CreateProjectResponse.getDefaultInstance());
responseObserver.onCompleted();
} catch (Exception e) {
log.error("Exception has occurred in the createProject method: ", e);
log.error("Exception has occurred in the CreateProject method: ", e);
responseObserver.onError(
Status.INTERNAL.withDescription(e.getMessage()).withCause(e).asRuntimeException());
}
Expand All @@ -170,7 +170,7 @@ public void archiveProject(
responseObserver.onNext(ArchiveProjectResponse.getDefaultInstance());
responseObserver.onCompleted();
} catch (Exception e) {
log.error("Exception has occurred in the createProject method: ", e);
log.error("Exception has occurred in the ArchiveProject method: ", e);
responseObserver.onError(
Status.INTERNAL.withDescription(e.getMessage()).withCause(e).asRuntimeException());
}
Expand All @@ -187,7 +187,7 @@ public void listProjects(
.build());
responseObserver.onCompleted();
} catch (Exception e) {
log.error("Exception has occurred in the listProjects method: ", e);
log.error("Exception has occurred in the ListProjects method: ", e);
responseObserver.onError(
Status.INTERNAL.withDescription(e.getMessage()).withCause(e).asRuntimeException());
}
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/feast/core/model/FeatureSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ private void setFeatureSpecFields(FeatureSpec.Builder featureSpecBuilder, Field
featureSpecBuilder.setTimeOfDayDomain(
TimeOfDayDomain.parseFrom(featureField.getTimeOfDayDomain()));
}

if (featureField.getLabels() != null) {
featureSpecBuilder.putAllLabels(featureField.getLabelsJSON());
}
}

/**
Expand Down
11 changes: 11 additions & 0 deletions core/src/main/java/feast/core/model/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

import feast.core.FeatureSetProto.EntitySpec;
import feast.core.FeatureSetProto.FeatureSpec;
import feast.core.util.TypeConversion;
import feast.types.ValueProto.ValueType;
import java.util.Arrays;
import java.util.Map;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Embeddable;
Expand Down Expand Up @@ -47,6 +49,10 @@ public class Field {
@Column(name = "project")
private String project;

// Labels that this field belongs to
@Column(name = "labels", columnDefinition = "text")
private String labels;

// Presence constraints (refer to proto feast.core.FeatureSet.FeatureSpec)
// Only one of them can be set.
private byte[] presence;
Expand Down Expand Up @@ -82,6 +88,7 @@ public Field(String name, ValueType.Enum type) {
public Field(FeatureSpec featureSpec) {
this.name = featureSpec.getName();
this.type = featureSpec.getValueType().toString();
this.labels = TypeConversion.convertMapToJsonString(featureSpec.getLabelsMap());

switch (featureSpec.getPresenceConstraintsCase()) {
case PRESENCE:
Expand Down Expand Up @@ -215,6 +222,10 @@ public Field(EntitySpec entitySpec) {
}
}

public Map<String, String> getLabelsJSON() {
return TypeConversion.convertJsonStringToMap(this.labels);
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
3 changes: 3 additions & 0 deletions protos/feast/core/FeatureSet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ message FeatureSpec {
tensorflow.metadata.v0.TimeDomain time_domain = 17;
tensorflow.metadata.v0.TimeOfDayDomain time_of_day_domain = 18;
}

// Labels for user defined metadata on feature
map<string,string> labels=19;
}

message FeatureSetMeta {
Expand Down