Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions core/src/main/java/feast/core/validators/SpecValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ public void validateImportSpec(ImportSpec spec) throws IllegalArgumentException
case "pubsub":
checkPubSubImportSpecOption(spec);
break;
case "file":
case "file.csv":
case "file.json":
checkFileImportSpecOption(spec);
checkArgument(
!spec.getSchema().getEntityIdColumn().equals(""),
Expand Down Expand Up @@ -257,9 +258,6 @@ public void validateImportSpec(ImportSpec spec) throws IllegalArgumentException

private void checkFileImportSpecOption(ImportSpec spec) throws IllegalArgumentException {
try {
checkArgument(
Lists.newArrayList("json", "csv").contains(spec.getOptionsOrThrow("format")),
"File format must be of type 'json' or 'csv'");
checkArgument(!spec.getOptionsOrDefault("path", "").equals(""), "File path cannot be empty");
} catch (NullPointerException | IllegalArgumentException e) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,10 @@ public void fileImportSpecWithoutSupportedFileFormatShouldThrowIllegalArgumentEx
featureGroupInfoRepository,
featureInfoRepository);
ImportSpec input =
ImportSpec.newBuilder().setType("file").putOptions("format", "notSupported").build();
ImportSpec.newBuilder().setType("file.wat?").build();
exception.expect(IllegalArgumentException.class);
exception.expectMessage(
"Validation for import spec failed: Invalid options: File format must be of type 'json' or 'csv'");
"Validation for import spec failed: Type file.wat? not supported");
validator.validateImportSpec(input);
}

Expand All @@ -652,7 +652,7 @@ public void fileImportSpecWithoutValidPathShouldThrowIllegalArgumentException()
entityInfoRepository,
featureGroupInfoRepository,
featureInfoRepository);
ImportSpec input = ImportSpec.newBuilder().setType("file").putOptions("format", "csv").build();
ImportSpec input = ImportSpec.newBuilder().setType("file.csv").build();
exception.expect(IllegalArgumentException.class);
exception.expectMessage(
"Validation for import spec failed: Invalid options: File path cannot be empty");
Expand All @@ -669,8 +669,7 @@ public void fileImportSpecWithoutEntityIdColumnInSchemaShouldThrowIllegalArgumen
featureInfoRepository);
ImportSpec input =
ImportSpec.newBuilder()
.setType("file")
.putOptions("format", "csv")
.setType("file.csv")
.putOptions("path", "gs://asdasd")
.build();
exception.expect(IllegalArgumentException.class);
Expand Down
135 changes: 0 additions & 135 deletions ingestion/src/main/java/feast/ingestion/transform/FeatureRowCsvIO.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading