-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add computation and retrieval of batch feature statistics #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
57cd368
Add support for historical feature statistics on bigquery
254c366
Add end-to-end test
639158e
Remove reference at feature level. Stats retrieval should be from Sta…
6d22f12
Add example notebook
f7f80b8
Minor fixes, add force refresh end to end test
7a3a394
Remove tfx schema from entities
0dc1f07
Group tests by serving type
e221414
Remove stutter in fixture
ba0b535
Add tfx-bsl to dependencies
9118554
Remove tfx-bsl from dependencies
7a7a5b5
Fix tests
baf4b88
Clear and assign hist field
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * Copyright 2018-2019 The Feast Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package feast.core.model; | ||
|
|
||
| import feast.core.FeatureSetProto.EntitySpec; | ||
| import feast.types.ValueProto.ValueType; | ||
| import java.util.Objects; | ||
| import javax.persistence.EmbeddedId; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| /** Feast entity object. Contains name, type as well as domain metadata about the entity. */ | ||
| @Getter | ||
| @Setter | ||
| @javax.persistence.Entity | ||
| public class Entity { | ||
| @EmbeddedId private EntityReference reference; | ||
|
|
||
| private String type; | ||
|
|
||
| public Entity() {} | ||
|
|
||
| private Entity(String name, ValueType.Enum type) { | ||
| this.setReference(new EntityReference(name)); | ||
| this.setType(type.toString()); | ||
| } | ||
|
|
||
| public static Entity withRef(EntityReference entityRef) { | ||
| Entity entity = new Entity(); | ||
| entity.setReference(entityRef); | ||
| return entity; | ||
| } | ||
|
|
||
| public static Entity fromProto(EntitySpec entitySpec) { | ||
| Entity entity = new Entity(entitySpec.getName(), entitySpec.getValueType()); | ||
| return entity; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| Entity feature = (Entity) o; | ||
| return getReference().equals(feature.getReference()) && getType().equals(feature.getType()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(super.hashCode(), getReference(), getType()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| /* | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * Copyright 2018-2020 The Feast Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package feast.core.model; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.Objects; | ||
| import javax.persistence.Column; | ||
| import javax.persistence.Embeddable; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
|
|
||
| @Embeddable | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Getter | ||
| @Setter | ||
| public class EntityReference implements Serializable { | ||
| // Project the field belongs to | ||
| @Column(nullable = false) | ||
| private String project; | ||
|
|
||
| // Feature set the field belongs to | ||
| @Column(name = "feature_set", nullable = false) | ||
| private String featureSet; | ||
|
|
||
| // Version of the feature set this field belongs to | ||
| @Column(nullable = false) | ||
| private int version; | ||
|
|
||
| // Name of the field | ||
| @Column(nullable = false) | ||
| private String name; | ||
|
|
||
| EntityReference(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| EntityReference fieldId = (EntityReference) o; | ||
| return Objects.equals(name, fieldId.getName()) | ||
| && Objects.equals(project, fieldId.getProject()) | ||
| && Objects.equals(featureSet, fieldId.getFeatureSet()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(super.hashCode(), project, featureSet, name); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.