Skip to content

Commit

Permalink
Modify for the renaming of metric spec defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
riemanli committed Jun 5, 2023
1 parent 136c0cc commit 7b68991
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ kt_jvm_library(
"//src/main/kotlin/org/wfanet/measurement/api:api_key_constants",
"//src/main/kotlin/org/wfanet/measurement/api:public_api_version",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api:encryption_key_pair_store",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:metric_spec_builder",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:metric_spec_defaults",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:principal_server_interceptor",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:proto_conversions",
"//src/main/kotlin/org/wfanet/measurement/reporting/service/api/v2alpha:reporting_principal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ReportsService(
val internalTimeRange: InternalTimeRange,
)

private val metricSpecBuilder = MetricSpecBuilder(metricSpecConfig)
private val metricSpecDefaults = MetricSpecDefaults(metricSpecConfig)

override suspend fun createReport(request: CreateReportRequest): Report {
grpcRequireNotNull(MeasurementConsumerKey.fromName(request.parent)) {
Expand Down Expand Up @@ -449,8 +449,8 @@ class ReportsService(
this.externalReportingSetId = externalReportingSetId
this.metricSpec =
try {
metricSpecBuilder.buildMetricSpec(metricSpec).toInternal()
} catch (e: MetricSpecBuildingException) {
metricSpecDefaults.specifyDefaults(metricSpec).toInternal()
} catch (e: MetricSpecDefaultsException) {
failGrpc(Status.INVALID_ARGUMENT) {
listOfNotNull("Invalid metric spec.", e.message, e.cause?.message)
.joinToString(separator = "\n")
Expand Down

0 comments on commit 7b68991

Please sign in to comment.