Skip to content

Commit

Permalink
Move TFDV stats to higher-numbered protobuf fields (#669)
Browse files Browse the repository at this point in the history
Within the Feast v0.5 release cycle these fields have not been in a
release yet, so it's safe to renumber them.

The motivation is reserving the lower-numbered fields for optimal
encoding, referenced in the patch.

Closes #667
  • Loading branch information
ches authored May 1, 2020
1 parent b636e6c commit e014733
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions protos/feast/core/FeatureSet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,48 +120,55 @@ message FeatureSpec {
// Value type of the feature.
feast.types.ValueType.Enum value_type = 2;

// Reserve field numbers 15 and below for fields that will almost always be set
// https://developers.google.com/protocol-buffers/docs/proto3#assigning-field-numbers
reserved 3 to 15;

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

// Reserved for fundamental future additions less noisy in the schema that TFDV stats fields
reserved 17 to 29;

// presence_constraints, shape_type and domain_info are referenced from:
// https://github.com/tensorflow/metadata/blob/36f65d1268cbc92cdbcf812ee03dcf47fb53b91e/tensorflow_metadata/proto/v0/schema.proto#L107

oneof presence_constraints {
// Constraints on the presence of this feature in the examples.
tensorflow.metadata.v0.FeaturePresence presence = 3;
tensorflow.metadata.v0.FeaturePresence presence = 30;
// Only used in the context of a "group" context, e.g., inside a sequence.
tensorflow.metadata.v0.FeaturePresenceWithinGroup group_presence = 4;
tensorflow.metadata.v0.FeaturePresenceWithinGroup group_presence = 31;
}

// The shape of the feature which governs the number of values that appear in
// each example.
oneof shape_type {
// The feature has a fixed shape corresponding to a multi-dimensional
// tensor.
tensorflow.metadata.v0.FixedShape shape = 5;
tensorflow.metadata.v0.FixedShape shape = 32;
// The feature doesn't have a well defined shape. All we know are limits on
// the minimum and maximum number of values.
tensorflow.metadata.v0.ValueCount value_count = 6;
tensorflow.metadata.v0.ValueCount value_count = 33;
}

// Domain for the values of the feature.
oneof domain_info {
// Reference to a domain defined at the schema level.
string domain = 7;
string domain = 34;
// Inline definitions of domains.
tensorflow.metadata.v0.IntDomain int_domain = 8;
tensorflow.metadata.v0.FloatDomain float_domain = 9;
tensorflow.metadata.v0.StringDomain string_domain = 10;
tensorflow.metadata.v0.BoolDomain bool_domain = 11;
tensorflow.metadata.v0.StructDomain struct_domain = 12;
tensorflow.metadata.v0.IntDomain int_domain = 35;
tensorflow.metadata.v0.FloatDomain float_domain = 36;
tensorflow.metadata.v0.StringDomain string_domain = 37;
tensorflow.metadata.v0.BoolDomain bool_domain = 38;
tensorflow.metadata.v0.StructDomain struct_domain = 39;
// Supported semantic domains.
tensorflow.metadata.v0.NaturalLanguageDomain natural_language_domain = 13;
tensorflow.metadata.v0.ImageDomain image_domain = 14;
tensorflow.metadata.v0.MIDDomain mid_domain = 15;
tensorflow.metadata.v0.URLDomain url_domain = 16;
tensorflow.metadata.v0.TimeDomain time_domain = 17;
tensorflow.metadata.v0.TimeOfDayDomain time_of_day_domain = 18;
tensorflow.metadata.v0.NaturalLanguageDomain natural_language_domain = 40;
tensorflow.metadata.v0.ImageDomain image_domain = 41;
tensorflow.metadata.v0.MIDDomain mid_domain = 42;
tensorflow.metadata.v0.URLDomain url_domain = 43;
tensorflow.metadata.v0.TimeDomain time_domain = 44;
tensorflow.metadata.v0.TimeOfDayDomain time_of_day_domain = 45;
}

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

message FeatureSetMeta {
Expand Down

0 comments on commit e014733

Please sign in to comment.