Skip to content
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

Update Feast Core list features method #1176

Merged
merged 5 commits into from
Nov 20, 2020

Conversation

terryyylim
Copy link
Member

What this PR does / why we need it:
Currently, listFeatures method is not updated to return features from feature tables, but rather feature sets.
This PR includes:

  • Updated ListFeaturesResponse proto
  • Updated SpecService to retrieve features from feature tables
  • Updated REST (GET) endpoint for listing features

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Users can now retrieve features registered in feature tables.

Signed-off-by: Terence <terencelimxp@gmail.com>
Signed-off-by: Terence <terencelimxp@gmail.com>
@terryyylim
Copy link
Member Author

/retest

@@ -1359,7 +1386,7 @@ public void shouldReturnNoTables() {
StatusRuntimeException.class,
() -> apiClient.simpleGetFeatureTable(projectName, featureTableName));

assertThat(featureTables.size(), equalTo(0));
assertThat(featureTables.size(), equalTo(1));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is called "should ReturnNoTables", isn't there contradiction?

* @param features List of features to insert to map.
* @return Map of featureRef:feature.
*/
public Map<String, FeatureV2> getFeaturesRefToFeaturesMap(List<FeatureV2> features) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this method is public? Seems that it's being only used by getFeaturesByRef

* @param featureReference to render as string
* @return string representation of feature reference.
*/
public static String renderFeatureRef(ServingAPIProto.FeatureReferenceV2 featureReference) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this method? It just wraps single function call

* @param labelsFilter contain labels that should be attached to FeatureTable's features
* @return Map of Feature references and Features
*/
public Map<String, FeatureV2> getFeaturesByRef(Map<String, String> labelsFilter) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name is a little bit confusing. It looks more like getFeaturesByLabels

@@ -311,11 +328,15 @@ public void shouldUseDefaultProjectIfProjectUnspecified() {
.build();
List<FeatureTableProto.FeatureTable> featureTables =
apiClient.simpleListFeatureTables(filter);
System.out.println(featureTables);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug?

Signed-off-by: Terence <terencelimxp@gmail.com>
Signed-off-by: Terence <terencelimxp@gmail.com>
Signed-off-by: Terence <terencelimxp@gmail.com>
@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pyalex, terryyylim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pyalex
Copy link
Collaborator

pyalex commented Nov 20, 2020

/lgtm

@feast-ci-bot feast-ci-bot merged commit 77a83fd into feast-dev:master Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants