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

Add a feast plan command, and have CLI output differentiates between created, deleted and unchanged objects #2147

Merged
merged 10 commits into from
Dec 16, 2021

Conversation

achals
Copy link
Member

@achals achals commented Dec 15, 2021

Signed-off-by: Achal Shah achals@gmail.com

What this PR does / why we need it:
Follow up to #2142 , this method uses the info from the refactored tag methods to print out new output.

Screen Shot 2021-12-14 at 9 47 19 PM

Does this PR introduce a user-facing change?:

Add a `feast plan` command.
`feast plan` and `feast apply` CLI output now differentiates between created, deleted and unchanged objects.

@achals achals added the kind/feature New feature or request label Dec 15, 2021
@achals achals requested a review from a team as a code owner December 15, 2021 05:58
@achals achals requested review from tsotnet and removed request for a team December 15, 2021 05:58
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
@achals achals changed the title Print changes in the repo objects in the new style during feast apply Add a feast plan command, and have CLI output differentiates between created, deleted and unchanged objects Dec 15, 2021
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
@judahrand
Copy link
Member

Does this also distinguish Updated from Created?

@achals
Copy link
Member Author

achals commented Dec 15, 2021

Does this also distinguish Updated from Created?

The plan is to do that in a separate PR - but yes, we should be able to infer and print out updated fields for objects.

This pr doesn't really grok in place updates to objects yet.

Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
Signed-off-by: Achal Shah <achals@gmail.com>
]
] = None,
partial: bool = True,
):
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: return type should be diff

Copy link
Member Author

Choose a reason for hiding this comment

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

yup

@@ -358,7 +360,7 @@ def _get_features(self, features: Union[List[str], FeatureService],) -> List[str
return _feature_refs

@log_exceptions_and_usage
def apply(
def plan(
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's extremely unintuitive to me that plan already has a concept of objects to keep and delete - after all, the point of planning should be to determine which things to keep, add, and delete

what I had in mind with plan was to reconstruct a full RegistryProto from a ParsedRepo, and then compare that with the existing registry - thoughts on this approach vs. yours?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I think that make sense. Lemme update.

Signed-off-by: Achal Shah <achals@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2021

Codecov Report

Merging #2147 (cf8ce45) into master (ec41653) will increase coverage by 0.09%.
The diff coverage is 56.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2147      +/-   ##
==========================================
+ Coverage   84.60%   84.70%   +0.09%     
==========================================
  Files         101      101              
  Lines        7966     8035      +69     
==========================================
+ Hits         6740     6806      +66     
- Misses       1226     1229       +3     
Flag Coverage Δ
integrationtests 74.59% <45.04%> (-0.29%) ⬇️
unittests 58.87% <56.75%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/tests/doctest/test_all.py 89.65% <20.00%> (-3.08%) ⬇️
sdk/python/feast/repo_operations.py 49.05% <27.02%> (-1.19%) ⬇️
sdk/python/feast/cli.py 38.34% <36.36%> (-0.07%) ⬇️
sdk/python/feast/registry_store.py 68.42% <57.14%> (-6.58%) ⬇️
sdk/python/feast/registry.py 87.19% <58.82%> (+0.86%) ⬆️
sdk/python/feast/diff/FcoDiff.py 88.00% <100.00%> (+17.16%) ⬆️
sdk/python/feast/feature_store.py 91.37% <100.00%> (+0.50%) ⬆️
...ion/test_cli_apply_duplicated_featureview_names.py 100.00% <100.00%> (ø)
sdk/python/feast/infra/utils/aws_utils.py 84.78% <0.00%> (-0.73%) ⬇️
.../python/tests/integration/registration/test_cli.py 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec41653...cf8ce45. Read the comment docs.

Copy link
Collaborator

@felixwang9817 felixwang9817 left a comment

Choose a reason for hiding this comment

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

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, felixwang9817

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:
  • OWNERS [achals,felixwang9817]

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

@feast-ci-bot feast-ci-bot merged commit ce243a4 into feast-dev:master Dec 16, 2021
@@ -128,32 +129,85 @@ def __init__(
else 0
)

def clone(self) -> "Registry":
new_registry = Registry(None, None)
new_registry.cached_registry_proto_ttl = timedelta(seconds=0)
Copy link
Member

Choose a reason for hiding this comment

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

Why set the new_registry.cached_registry_proto_ttl to 0 seconds?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@judahrand I'm actually not sure why, but we don't actually use this clone method anymore (I'll delete it in a future PR)

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.

6 participants