-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make Projects optional & Update Feature References #693
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
Merged
feast-ci-bot
merged 21 commits into
feast-dev:master
from
mrzzy:optional-projects-flexible-feature-refs
May 19, 2020
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6a61582
Squash and rebase on master
4b694d5
Change SpecServiceTest to use global default project constant.
68b9482
Make AccessManagementService's archiveProject() throw UnimplementOper…
1d74ce5
Correct incorrect documentation on source being ignored on Core's App…
179819a
Use ValueProto.Value in java SDK's FeastClient lambda instead of gene…
78c5fdd
Clarify how the ignore project param of feature ref to string() worke…
e9befcf
Correct missing test to check for empty feature refs in java SDK.
dce338d
Clarified ref_protos to feature_ref_protos to make code clearer
88cae23
Rename ServingService's FeatureReference proto 'feature_set_name` to …
e67abab
Remove nested function strip_project() with loop with python SDK's cl…
96b5fed
Remove extra version paramter in python sdk test's TestFeatureRef
11d1c31
Change CachedSpecService's "hasProject == true" to more concise "!has…
0aaf56e
Removed setFeatureSet() calls to OnlineServingServiceTest as it does …
ab9cdc6
Make client.set_project() without args reset project to default in py…
6bfcccb
Updated e2e to test for feature set inference for feature ref without…
12c7087
Remove unused field max_age in FeatureReference
19d1f8a
Fix typo in e2e
713b5bd
Fix error in e2e tests regarding string splits
15ac15e
Optimise Serving's CachedSpecService populateCache() by directly assi…
dbfec8d
Remove final in CachedSpecService to allow assignment in featureToFea…
adeb743
Remove unnescessary copy of list in QueryTemplater
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
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
74 changes: 74 additions & 0 deletions
74
core/src/test/java/feast/core/service/AccessManagementServiceTest.java
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,74 @@ | ||
| /* | ||
| * 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.service; | ||
|
|
||
| import static org.mockito.Mockito.verify; | ||
| import static org.mockito.Mockito.when; | ||
| import static org.mockito.MockitoAnnotations.initMocks; | ||
|
|
||
| import feast.core.dao.ProjectRepository; | ||
| import feast.core.model.Project; | ||
| import java.util.Optional; | ||
| import org.junit.Before; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
| import org.junit.rules.ExpectedException; | ||
| import org.mockito.Mock; | ||
|
|
||
| public class AccessManagementServiceTest { | ||
| @Rule public ExpectedException expectedException = ExpectedException.none(); | ||
| // mocks | ||
| @Mock private ProjectRepository projectRepository; | ||
| // dummy models | ||
| private Project defaultProject; | ||
| private Project testProject; | ||
|
|
||
| // test target | ||
| private AccessManagementService accessService; | ||
|
|
||
| @Before | ||
| public void setup() { | ||
| initMocks(this); | ||
| // setup dummy models for testing | ||
| this.defaultProject = new Project(Project.DEFAULT_NAME); | ||
| this.testProject = new Project("project"); | ||
| // setup test target | ||
| when(this.projectRepository.existsById(Project.DEFAULT_NAME)).thenReturn(false); | ||
| this.accessService = new AccessManagementService(this.projectRepository); | ||
| } | ||
|
|
||
| @Test | ||
| public void testDefaultProjectCreateInConstructor() { | ||
| verify(this.projectRepository).saveAndFlush(this.defaultProject); | ||
| } | ||
|
|
||
| @Test | ||
| public void testArchiveProject() { | ||
| when(this.projectRepository.findById("project")).thenReturn(Optional.of(this.testProject)); | ||
| this.accessService.archiveProject("project"); | ||
| this.testProject.setArchived(true); | ||
| verify(this.projectRepository).saveAndFlush(this.testProject); | ||
| // reset archived flag | ||
| this.testProject.setArchived(false); | ||
| } | ||
|
|
||
| @Test | ||
| public void shouldNotArchiveDefaultProject() { | ||
| expectedException.expect(IllegalArgumentException.class); | ||
| this.accessService.archiveProject(Project.DEFAULT_NAME); | ||
| } | ||
| } |
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
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.