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

Catch errors thrown by BQ during entity table loading #371

Merged
merged 3 commits into from
Dec 17, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void getOnlineFeatures(
responseObserver.onNext(onlineFeatures);
responseObserver.onCompleted();
} catch (Exception e) {
log.warn("Failed to get Online Features", e);
responseObserver.onError(e);
}
span.finish();
Expand All @@ -88,6 +89,7 @@ public void getBatchFeatures(
responseObserver.onNext(batchFeatures);
responseObserver.onCompleted();
} catch (Exception e) {
log.warn("Failed to get Batch Features", e);
responseObserver.onError(e);
}
}
Expand All @@ -99,6 +101,7 @@ public void getJob(GetJobRequest request, StreamObserver<GetJobResponse> respons
responseObserver.onNext(response);
responseObserver.onCompleted();
} catch (Exception e) {
log.warn("Failed to get Job", e);
responseObserver.onError(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,26 @@ public GetBatchFeaturesResponse getBatchFeatures(GetBatchFeaturesRequest getFeat
.asRuntimeException();
}

Table entityTable = loadEntities(getFeaturesRequest.getDatasetSource());
Table entityTable;
String entityTableName;
try {
entityTable = loadEntities(getFeaturesRequest.getDatasetSource());

TableId entityTableWithUUIDs = generateUUIDs(entityTable);
entityTableName = generateFullTableName(entityTableWithUUIDs);
} catch (Exception e) {
throw Status.INTERNAL
.withDescription("Unable to load entity dataset to Bigquery")
woop marked this conversation as resolved.
Show resolved Hide resolved
.asRuntimeException();
}

Schema entityTableSchema = entityTable.getDefinition().getSchema();
List<String> entityNames =
entityTableSchema.getFields().stream()
.map(Field::getName)
.filter(name -> !name.equals("event_timestamp"))
.collect(Collectors.toList());

TableId entityTableWithUUIDs = generateUUIDs(entityTable);
String entityTableName = generateFullTableName(entityTableWithUUIDs);

List<FeatureSetInfo> featureSetInfos =
QueryTemplater.getFeatureSetInfos(featureSetSpecs, getFeaturesRequest.getFeatureSetsList());

Expand Down