|
17 | 17 | package feast.core.service; |
18 | 18 |
|
19 | 19 | import static feast.core.validators.Matchers.checkValidCharacters; |
20 | | -import static feast.core.validators.Matchers.checkValidCharactersAllowAsterisk; |
| 20 | +import static feast.core.validators.Matchers.checkValidCharactersAllowDash; |
21 | 21 |
|
22 | 22 | import com.google.protobuf.InvalidProtocolBufferException; |
23 | 23 | import feast.core.dao.EntityRepository; |
@@ -105,7 +105,7 @@ public GetEntityResponse getEntity(GetEntityRequest request) { |
105 | 105 | projectName = Project.DEFAULT_NAME; |
106 | 106 | } |
107 | 107 |
|
108 | | - checkValidCharacters(projectName, "project"); |
| 108 | + checkValidCharactersAllowDash(projectName, "project"); |
109 | 109 | checkValidCharacters(entityName, "entity"); |
110 | 110 |
|
111 | 111 | EntityV2 entity = entityRepository.findEntityByNameAndProject_Name(entityName, projectName); |
@@ -143,13 +143,13 @@ public ListFeaturesResponse listFeatures(ListFeaturesRequest.Filter filter) { |
143 | 143 | List<String> entities = filter.getEntitiesList(); |
144 | 144 | Map<String, String> labels = filter.getLabelsMap(); |
145 | 145 |
|
146 | | - checkValidCharactersAllowAsterisk(project, "project"); |
147 | | - |
148 | 146 | // Autofill default project if project not specified |
149 | 147 | if (project.isEmpty()) { |
150 | 148 | project = Project.DEFAULT_NAME; |
151 | 149 | } |
152 | 150 |
|
| 151 | + checkValidCharactersAllowDash(project, "project"); |
| 152 | + |
153 | 153 | // Currently defaults to all FeatureTables |
154 | 154 | List<FeatureTable> featureTables = tableRepository.findAllByProject_Name(project); |
155 | 155 |
|
@@ -200,7 +200,7 @@ public ListEntitiesResponse listEntities(ListEntitiesRequest.Filter filter) { |
200 | 200 | project = Project.DEFAULT_NAME; |
201 | 201 | } |
202 | 202 |
|
203 | | - checkValidCharacters(project, "project"); |
| 203 | + checkValidCharactersAllowDash(project, "project"); |
204 | 204 |
|
205 | 205 | List<EntityV2> entities = entityRepository.findAllByProject_Name(project); |
206 | 206 |
|
@@ -271,6 +271,8 @@ public ApplyEntityResponse applyEntity( |
271 | 271 | projectName = Project.DEFAULT_NAME; |
272 | 272 | } |
273 | 273 |
|
| 274 | + checkValidCharactersAllowDash(projectName, "project"); |
| 275 | + |
274 | 276 | // Validate incoming entity |
275 | 277 | EntityValidator.validateSpec(newEntitySpec); |
276 | 278 |
|
@@ -368,6 +370,8 @@ public UpdateStoreResponse updateStore(UpdateStoreRequest updateStoreRequest) |
368 | 370 | public ApplyFeatureTableResponse applyFeatureTable(ApplyFeatureTableRequest request) { |
369 | 371 | String projectName = resolveProjectName(request.getProject()); |
370 | 372 |
|
| 373 | + checkValidCharactersAllowDash(projectName, "project"); |
| 374 | + |
371 | 375 | // Check that specification provided is valid |
372 | 376 | FeatureTableSpec applySpec = request.getTableSpec(); |
373 | 377 | FeatureTableValidator.validateSpec(applySpec); |
@@ -411,7 +415,7 @@ public ListFeatureTablesResponse listFeatureTables(ListFeatureTablesRequest.Filt |
411 | 415 | String projectName = resolveProjectName(filter.getProject()); |
412 | 416 | Map<String, String> labelsFilter = filter.getLabelsMap(); |
413 | 417 |
|
414 | | - checkValidCharacters(projectName, "project"); |
| 418 | + checkValidCharactersAllowDash(projectName, "project"); |
415 | 419 |
|
416 | 420 | List<FeatureTable> matchingTables = tableRepository.findAllByProject_Name(projectName); |
417 | 421 |
|
@@ -444,7 +448,7 @@ public GetFeatureTableResponse getFeatureTable(GetFeatureTableRequest request) { |
444 | 448 | String projectName = resolveProjectName(request.getProject()); |
445 | 449 | String featureTableName = request.getName(); |
446 | 450 |
|
447 | | - checkValidCharacters(projectName, "project"); |
| 451 | + checkValidCharactersAllowDash(projectName, "project"); |
448 | 452 | checkValidCharacters(featureTableName, "featureTable"); |
449 | 453 |
|
450 | 454 | Optional<FeatureTable> retrieveTable = |
@@ -474,7 +478,7 @@ public void deleteFeatureTable(DeleteFeatureTableRequest request) { |
474 | 478 | String projectName = resolveProjectName(request.getProject()); |
475 | 479 | String featureTableName = request.getName(); |
476 | 480 |
|
477 | | - checkValidCharacters(projectName, "project"); |
| 481 | + checkValidCharactersAllowDash(projectName, "project"); |
478 | 482 | checkValidCharacters(featureTableName, "featureTable"); |
479 | 483 |
|
480 | 484 | Optional<FeatureTable> existingTable = |
|
0 commit comments