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

Make sure FeatureViews with same name can not be applied at the same … #1651

Merged
merged 5 commits into from
Jul 28, 2021

Conversation

tedhtchang
Copy link
Contributor

@tedhtchang tedhtchang commented Jun 17, 2021

What this PR does / why we need it:
Make sure FeatureViews with same name can not be applied at the same time.

Which issue(s) this PR fixes:
Fix #1625

Does this PR introduce a user-facing change?:

Users will get an error when trying to apply feature views with the same name.

@feast-ci-bot
Copy link
Collaborator

Hi @tedhtchang. Thanks for your PR.

I'm waiting for a feast-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -220,7 +220,17 @@ def apply(
objects = [objects]
assert isinstance(objects, list)

views_to_update = [ob for ob in objects if isinstance(ob, FeatureView)]
views_to_update = []
view_name_list = []
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps simpler to use a dict?

Copy link
Member

Choose a reason for hiding this comment

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

Or a set

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2021

Codecov Report

Merging #1651 (1baa0ee) into master (489a0f8) will increase coverage by 0.12%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1651      +/-   ##
==========================================
+ Coverage   79.08%   79.21%   +0.12%     
==========================================
  Files          80       81       +1     
  Lines        6855     6994     +139     
==========================================
+ Hits         5421     5540     +119     
- Misses       1434     1454      +20     
Flag Coverage Δ
integrationtests 79.13% <95.23%> (+0.13%) ⬆️
unittests 62.07% <95.23%> (+0.33%) ⬆️

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

Impacted Files Coverage Δ
sdk/python/feast/repo_operations.py 31.19% <50.00%> (-0.15%) ⬇️
...sts/integration/registration/test_feature_store.py 99.31% <90.00%> (-0.69%) ⬇️
sdk/python/feast/feature_store.py 93.66% <100.00%> (+0.16%) ⬆️
...ion/test_cli_apply_duplicated_featureview_names.py 100.00% <100.00%> (ø)
sdk/python/feast/entity.py 73.98% <0.00%> (-2.60%) ⬇️
sdk/python/feast/feature_view.py 86.95% <0.00%> (-2.28%) ⬇️
sdk/python/feast/infra/offline_stores/redshift.py 89.80% <0.00%> (-1.11%) ⬇️
sdk/python/feast/feature.py 75.00% <0.00%> (ø)
sdk/python/feast/feature_service.py 71.21% <0.00%> (ø)
... and 3 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 489a0f8...1baa0ee. Read the comment docs.

@woop
Copy link
Member

woop commented Jun 25, 2021

@tedhtchang from a readability standpoint, would you be able to pull out this validation into standalone function? Perhaps something like

validate_repo(repo: ParsedRepo)? or alternatively validate_feature_views(feature_views: List[FeatureView])?

@tedhtchang
Copy link
Contributor Author

@woop @achals Do we need more action for this PR?

@achals
Copy link
Member

achals commented Jul 15, 2021

@tedhtchang can we add a test? Other than that and DCO, the change looks good to me.

Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

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

waiting on tests

@tedhtchang tedhtchang force-pushed the validate_duplicate_fv_name branch 2 times, most recently from 5f89216 to e338738 Compare July 17, 2021 10:12
Copy link
Member

@achals achals left a comment

Choose a reason for hiding this comment

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

/lgtm

@tedhtchang tedhtchang force-pushed the validate_duplicate_fv_name branch 2 times, most recently from 2bbbc44 to 083447a Compare July 23, 2021 08:29
@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, tedhtchang, 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

@woop
Copy link
Member

woop commented Jul 23, 2021

/lgtm

@tedhtchang
Copy link
Contributor Author

/cc @achals @woop
I just resolved some conflict from the master branch.

@achals
Copy link
Member

achals commented Jul 28, 2021

/lgtm

@feast-ci-bot feast-ci-bot merged commit 7972992 into feast-dev:master Jul 28, 2021
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.

Validate against duplicate FeatureView names
5 participants