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

Introduce Entity as higher-level concept #1014

Merged
merged 15 commits into from
Sep 28, 2020

Conversation

terryyylim
Copy link
Member

@terryyylim terryyylim commented Sep 23, 2020

What this PR does / why we need it:
Introducing entities as a higher-level concept is the first step in generalizing Feast. The Feast v0.8 proposal which seeks to do so can be found here.

This PR does not include versioning of protos nor removal of existing EntitySpec concept. This will be done in a separate PR in the near future.

Which issue(s) this PR fixes:

Fixes #405

Does this PR introduce a user-facing change?:

Entities (as a higher-level concept) can now be registered and retrieved from Feast Core.

message ApplyEntityRequest {
// If project is unspecified, will default to 'default' project.
// If project specified does not exist, the project would be automatically created.
feast.core.Entity entity = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which parts of the entity can be updated?

Copy link
Member Author

Choose a reason for hiding this comment

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

That can be found here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it make more sense to expose only EntitySpecV2 instead to users, as the other (meta) fields are set by Feast?

Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed, EntitySpecV2 should be here instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@mrzzy
Copy link
Collaborator

mrzzy commented Sep 23, 2020

Make sure to update go language definitions your new protobufs with make compile-go-protos and commit them.

* @param filter Filter containing the desired entity name, project and labels
* @return ListEntitiesResponse with list of entities found matching the filter
*/
public ListEntitiesResponse listEntities(ListEntitiesRequest.Filter filter) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a strong use for this wildcard filters or can we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it'll be easier to locate a set of entities that are registered with a certain pattern within a project.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but is there a need for it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a strong need, have removed it.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, what have you removed? I still see name.replace('*', '%'), project.replace('*', '%'))

Copy link
Member

Choose a reason for hiding this comment

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

If its easier to keep in then we can keep it in, but this seems like a lot of complexity to keep if we dont actually need it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I disallowed searching for wildcard names in a specific project. So if we're removing wildcard filters, should we update the proto to only consider project and labels in the Filter then?

Copy link
Member Author

@terryyylim terryyylim Sep 26, 2020

Choose a reason for hiding this comment

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

Doesn't seem very useful to have entity name in the filter since it'll just return that entity in a list. The user might be better off using getEntity in this case.

sdk/python/feast/client.py Outdated Show resolved Hide resolved
sdk/python/feast/client.py Outdated Show resolved Hide resolved
sdk/python/feast/entity.py Outdated Show resolved Hide resolved
sdk/python/feast/entity.py Outdated Show resolved Hide resolved
@woop
Copy link
Member

woop commented Sep 23, 2020

Doesnt this PR introduce a user facing change?

@terryyylim terryyylim changed the title Introduce Entity as higher-level concept WIP: Introduce Entity as higher-level concept Sep 23, 2020
@terryyylim terryyylim changed the title WIP: Introduce Entity as higher-level concept Introduce Entity as higher-level concept Sep 24, 2020
@@ -44,3 +55,273 @@ def from_proto(cls, entity_proto: EntityProto):
"""
entity = cls(name=entity_proto.name, dtype=ValueType(entity_proto.value_type))
return entity


class EntityV2:
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to expose the V2 to users? I think we can replace the existing Entity with this new one. Any concerns with that @mrzzy ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's okay, but we'll need to update (perhaps use another name?) the previous Entity implementation used in tests and feature set. However, this would introduce breaking change to existing users who are still using the featureset-entity concept.

eg. if they do something like

fs = FeatureSet(
        "featureset",
        features=[
            Feature("feat1", ValueType.STRING)
        ],
        entities=[Entity("entity_id", ValueType.INT64)],
        max_age=Duration(seconds=100),
    )

Copy link
Member Author

Choose a reason for hiding this comment

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

Will be updating SDK in separate PR, along with replacing existing e2e tests.

@woop
Copy link
Member

woop commented Sep 28, 2020

Looks good to me. I will approve. @pyalex can you lgtm when you are happy.

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Sep 28, 2020

/lgtm

@feast-ci-bot feast-ci-bot merged commit 87ee594 into feast-dev:master Sep 28, 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.

Entity types as a higher-level concept
5 participants