Skip to content

Commit cf45d0f

Browse files
pradithyafeast-ci-bot
authored andcommitted
Remove granularity (#162)
* Remove granularity from proto files * Remove granularity from serving * Remove granularity from proto files * Remove granularity from serving * Remove granularity from core * Remove granularity from Python SDK * Update generated protos, remove granularity * Remove granularity from ingestion * Scrub additional mentions of granularity * Update core-deploy template * Update chart distribution * Fix core service not overriding storage correctly * Shade core jar to include google nio lib * Remove granularity from UI * Update feature details page * Update Importer in Feast Python SDK to handle source options properly When the import source type is DataFrame
1 parent 6646402 commit cf45d0f

File tree

123 files changed

+1606
-2374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1606
-2374
lines changed

charts/dist/feast-0.1.0.tgz

-24 Bytes
Binary file not shown.

charts/dist/index.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ entries:
33
feast:
44
- apiVersion: v1
55
appVersion: 0.1.0
6-
created: 2019-03-15T19:35:11.848995-07:00
6+
created: 2019-03-21T18:38:21.941744229+08:00
77
description: A Helm chart to install Feast on kubernetes
8-
digest: cbc97b4be6a84a33055900b620d2f6b6176ee81d86eb2e8bfcc9096ea040ff47
8+
digest: 68584c58f742f3ed88040ae8658d549a2ee643334f01c684bad83e2937eae19e
99
name: feast
1010
urls:
1111
- feast-0.1.0.tgz
1212
version: 0.1.0
13-
generated: 2019-03-15T19:35:11.844526-07:00
13+
generated: 2019-03-21T18:38:21.937413876+08:00

charts/feast/templates/core-deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ spec:
9191
value: "{{ .Values.core.jobs.monitoring.period }}"
9292
- name: JOB_MONITOR_INITIAL_DELAY_MS
9393
value: "{{ .Values.core.jobs.monitoring.initialDelay }}"
94+
{{- if .Values.store }}
9495
{{- if .Values.store.serving }}
9596
- name: STORE_SERVING_TYPE
9697
value: {{ .Values.store.serving.type }}
@@ -109,6 +110,7 @@ spec:
109110
- name: STORE_ERRORS_OPTIONS
110111
value: {{ .Values.store.errors.options | toJson}}
111112
{{- end }}
113+
{{- end }}
112114
- name: STATSD_HOST
113115
value: {{ .Values.statsd.host }}
114116
- name: STATSD_PORT

cli/feast/pkg/parse/yaml.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func YamlToFeatureSpec(in []byte) (*specs.FeatureSpec, error) {
3434
if err != nil {
3535
return nil, err
3636
}
37-
ymlMap["granularity"] = granularityOf(ymlMap["granularity"].(string))
3837
ymlMap["valueType"] = valueTypeOf(ymlMap["valueType"].(string))
3938
if err != nil {
4039
return nil, err
@@ -131,10 +130,6 @@ func YamlToImportSpec(in []byte) (*specs.ImportSpec, error) {
131130
return &is, err
132131
}
133132

134-
func granularityOf(str string) types.Granularity_Enum {
135-
return types.Granularity_Enum(types.Granularity_Enum_value[str])
136-
}
137-
138133
func valueTypeOf(str string) types.ValueType_Enum {
139134
return types.ValueType_Enum(types.ValueType_Enum_value[str])
140135
}

cli/feast/pkg/parse/yaml_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,24 @@ func TestYamlToFeatureSpec(t *testing.T) {
3434
}{
3535
{
3636
name: "valid yaml",
37-
input: []byte(`id: test.none.test_feature_two
37+
input: []byte(`id: test.test_feature_two
3838
name: test_feature_two
3939
entity: test
4040
owner: bob@example.com
4141
description: testing feature
4242
valueType: INT64
43-
granularity: NONE
4443
uri: https://github.com/bob/example
4544
dataStores:
4645
serving:
4746
id: REDIS
4847
warehouse:
4948
id: BIGQUERY`),
5049
expected: &specs.FeatureSpec{
51-
Id: "test.none.test_feature_two",
50+
Id: "test.test_feature_two",
5251
Owner: "bob@example.com",
5352
Name: "test_feature_two",
5453
Description: "testing feature",
5554
Uri: "https://github.com/bob/example",
56-
Granularity: types.Granularity_NONE,
5755
ValueType: types.ValueType_INT64,
5856
Entity: "test",
5957
DataStores: &specs.DataStores{
@@ -257,7 +255,7 @@ schema:
257255
- name: timestamp
258256
- name: driver_id
259257
- name: last_opportunity
260-
featureId: driver.none.last_opportunity`),
258+
featureId: driver.last_opportunity`),
261259
expected: &specs.ImportSpec{
262260
Type: "file",
263261
JobOptions: map[string]string{
@@ -272,7 +270,7 @@ schema:
272270
Fields: []*specs.Field{
273271
{Name: "timestamp"},
274272
{Name: "driver_id"},
275-
{Name: "last_opportunity", FeatureId: "driver.none.last_opportunity"},
273+
{Name: "last_opportunity", FeatureId: "driver.last_opportunity"},
276274
},
277275
EntityIdColumn: "driver_id",
278276
Timestamp: &specs.Schema_TimestampValue{

cli/feast/pkg/printer/printer_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ func TestPrintFeature(t *testing.T) {
2323
name: "with storage",
2424
input: &core.UIServiceTypes_FeatureDetail{
2525
Spec: &specs.FeatureSpec{
26-
Id: "test.none.test_feature_two",
26+
Id: "test.test_feature_two",
2727
Owner: "bob@example.com",
2828
Name: "test_feature_two",
2929
Description: "testing feature",
3030
Uri: "https://github.com/bob/example",
31-
Granularity: types.Granularity_NONE,
3231
ValueType: types.ValueType_INT64,
3332
Entity: "test",
3433
DataStores: &specs.DataStores{
@@ -45,7 +44,7 @@ func TestPrintFeature(t *testing.T) {
4544
LastUpdated: &timestamp.Timestamp{Seconds: 1},
4645
Created: &timestamp.Timestamp{Seconds: 1},
4746
},
48-
expected: fmt.Sprintf(`Id: test.none.test_feature_two
47+
expected: fmt.Sprintf(`Id: test.test_feature_two
4948
Entity: test
5049
Owner: bob@example.com
5150
Description: testing feature
@@ -65,12 +64,11 @@ Related Jobs:
6564
name: "no storage",
6665
input: &core.UIServiceTypes_FeatureDetail{
6766
Spec: &specs.FeatureSpec{
68-
Id: "test.none.test_feature_two",
67+
Id: "test.test_feature_two",
6968
Owner: "bob@example.com",
7069
Name: "test_feature_two",
7170
Description: "testing feature",
7271
Uri: "https://github.com/bob/example",
73-
Granularity: types.Granularity_NONE,
7472
ValueType: types.ValueType_INT64,
7573
Entity: "test",
7674
},
@@ -79,7 +77,7 @@ Related Jobs:
7977
LastUpdated: &timestamp.Timestamp{Seconds: 1},
8078
Created: &timestamp.Timestamp{Seconds: 1},
8179
},
82-
expected: fmt.Sprintf(`Id: test.none.test_feature_two
80+
expected: fmt.Sprintf(`Id: test.test_feature_two
8381
Entity: test
8482
Owner: bob@example.com
8583
Description: testing feature

core/pom.xml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
~
1717
-->
1818
<project xmlns="http://maven.apache.org/POM/4.0.0"
19-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2121
<modelVersion>4.0.0</modelVersion>
2222
<parent>
2323
<groupId>feast</groupId>
@@ -31,8 +31,45 @@
3131
<build>
3232
<plugins>
3333
<plugin>
34-
<groupId>org.springframework.boot</groupId>
35-
<artifactId>spring-boot-maven-plugin</artifactId>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-shade-plugin</artifactId>
36+
<version>2.4.3</version>
37+
<configuration>
38+
<transformers>
39+
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
40+
<resource>META-INF/spring.handlers</resource>
41+
</transformer>
42+
<transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
43+
<resource>META-INF/spring.factories</resource>
44+
</transformer>
45+
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
46+
<resource>META-INF/spring.schemas</resource>
47+
</transformer>
48+
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
49+
<resource>META-INF/spring.components</resource>
50+
</transformer>
51+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
52+
<mainClass>feast.core.CoreApplication</mainClass>
53+
</transformer>
54+
<transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
55+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
56+
</transformers>
57+
</configuration>
58+
<executions>
59+
<execution>
60+
<phase>package</phase>
61+
<goals>
62+
<goal>shade</goal>
63+
</goals>
64+
</execution>
65+
</executions>
66+
<dependencies>
67+
<dependency>
68+
<groupId>org.springframework.boot</groupId>
69+
<artifactId>spring-boot-maven-plugin</artifactId>
70+
<version>${springBootVersion}</version>
71+
</dependency>
72+
</dependencies>
3673
</plugin>
3774
<plugin>
3875
<groupId>org.xolstice.maven.plugins</groupId>

core/src/main/java/feast/core/grpc/CoreServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public void applyFeature(
283283
}
284284

285285
public FeatureSpec applyDefaultStores(FeatureSpec featureSpec) {
286-
DataStores.Builder dataStoreBuilder = DataStores.newBuilder();
286+
DataStores.Builder dataStoreBuilder = featureSpec.getDataStores().toBuilder();
287287
if (Strings.isNullOrEmpty(featureSpec.getDataStores().getServing().getId())) {
288288
log.info("Feature has no serving store specified using default");
289289
if (storageSpecs.getServingStorageSpec() != null) {

core/src/main/java/feast/core/job/StatsdMetricPusher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void pushMetrics(List<Metrics> metrics) {
4343
// `row:result` <- all
4444
// `scope:scope_id:result` <- per scope, either feature or entity
4545
// for examples:
46-
// 1. feature:driver.minute.ping_sequence_weak_dir_change_mean:error
46+
// 1. feature:driver.ping_sequence_weak_dir_change_mean:error
4747
// 2. entity:driver:stored
4848
// currently there are 3 results:
4949
// 1. valid

core/src/main/java/feast/core/model/FeatureInfo.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import feast.specs.FeatureSpecProto.DataStore;
2424
import feast.specs.FeatureSpecProto.DataStores;
2525
import feast.specs.FeatureSpecProto.FeatureSpec;
26-
import feast.types.GranularityProto.Granularity;
2726
import feast.types.ValueProto.ValueType;
2827
import lombok.AllArgsConstructor;
2928
import lombok.Getter;
@@ -62,9 +61,6 @@ public class FeatureInfo extends AbstractTimestampEntity {
6261
@Column(name = "uri", nullable = false)
6362
private String uri;
6463

65-
@Enumerated(EnumType.STRING)
66-
private Granularity.Enum granularity;
67-
6864
@Enumerated(EnumType.STRING)
6965
private ValueType.Enum valueType;
7066

@@ -120,7 +116,6 @@ public FeatureInfo(
120116
this.owner = spec.getOwner();
121117
this.description = spec.getDescription();
122118
this.uri = spec.getUri();
123-
this.granularity = spec.getGranularity();
124119
this.valueType = spec.getValueType();
125120
this.entity = entityInfo;
126121
this.featureGroup = featureGroupInfo;
@@ -144,7 +139,6 @@ public FeatureInfo(FeatureInfo other) {
144139
this.owner = other.owner;
145140
this.description = other.description;
146141
this.uri = other.uri;
147-
this.granularity = other.granularity;
148142
this.valueType = other.valueType;
149143
this.entity = other.entity;
150144
this.featureGroup = other.featureGroup;
@@ -183,7 +177,6 @@ public FeatureSpec getFeatureSpec() {
183177
.setOwner(owner)
184178
.setDescription(description)
185179
.setUri(uri)
186-
.setGranularity(granularity)
187180
.setValueType(valueType)
188181
.setEntity(entity.getName())
189182
.addAllTags(convertTagStringToList(tags))
@@ -250,8 +243,8 @@ private String createBigqueryViewLink(StorageInfo warehouseStore) {
250243
String dataset = opts.get(BigQueryStorageManager.OPT_BIGQUERY_DATASET);
251244

252245
return String.format(
253-
"https://bigquery.cloud.google.com/table/%s:%s.%s_%s_view",
254-
projectId, dataset, entity.getName(), granularity.toString().toLowerCase());
246+
"https://bigquery.cloud.google.com/table/%s:%s.%s_view",
247+
projectId, dataset, entity.getName());
255248
}
256249

257250
/**
@@ -276,7 +269,6 @@ private boolean isLegalUpdate(FeatureSpec update) {
276269
FeatureSpec spec = this.getFeatureSpec();
277270
return spec.getName().equals(update.getName())
278271
&& spec.getEntity().equals(update.getEntity())
279-
&& spec.getGranularity().equals(update.getGranularity())
280272
&& spec.getValueType().equals(update.getValueType())
281273
&& spec.getGroup().equals(update.getGroup())
282274
&& spec.getOptionsMap().equals(update.getOptionsMap())

0 commit comments

Comments
 (0)