Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Borys Tkachenko committed Dec 13, 2024
1 parent 0d0d914 commit 5f81fa0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.comet.opik.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.validation.constraints.NotBlank;
Expand All @@ -13,4 +14,6 @@ public record ErrorInfo(
@NotBlank String exceptionType,
String message,
@NotBlank String traceback) {
public static final TypeReference<ErrorInfo> ERROR_INFO_TYPE = new TypeReference<>() {
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.comet.opik.domain;

import com.comet.opik.api.ErrorInfo;
import com.comet.opik.api.ProjectStats;
import com.comet.opik.api.Span;
import com.comet.opik.api.SpanSearchCriteria;
Expand All @@ -11,7 +10,6 @@
import com.comet.opik.domain.stats.StatsMapper;
import com.comet.opik.utils.JsonUtils;
import com.comet.opik.utils.TemplateUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Preconditions;
import io.opentelemetry.instrumentation.annotations.WithSpan;
Expand Down Expand Up @@ -43,6 +41,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.comet.opik.api.ErrorInfo.ERROR_INFO_TYPE;
import static com.comet.opik.domain.AsyncContextUtils.bindUserNameAndWorkspaceContextToStream;
import static com.comet.opik.domain.AsyncContextUtils.bindWorkspaceIdToFlux;
import static com.comet.opik.domain.AsyncContextUtils.bindWorkspaceIdToMono;
Expand Down Expand Up @@ -1089,8 +1088,7 @@ private Publisher<Span> mapToDto(Result result) {
.usage(row.get("usage", Map.class))
.errorInfo(Optional.ofNullable(row.get("error_info", String.class))
.filter(str -> !str.isBlank())
.map(errorInfo -> JsonUtils.readValue(errorInfo, new TypeReference<ErrorInfo>() {
}))
.map(errorInfo -> JsonUtils.readValue(errorInfo, ERROR_INFO_TYPE))
.orElse(null))
.createdAt(row.get("created_at", Instant.class))
.lastUpdatedAt(row.get("last_updated_at", Instant.class))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.comet.opik.domain;

import com.comet.opik.api.BiInformationResponse.BiInformation;
import com.comet.opik.api.ErrorInfo;
import com.comet.opik.api.ProjectStats;
import com.comet.opik.api.Trace;
import com.comet.opik.api.TraceSearchCriteria;
Expand All @@ -12,7 +11,6 @@
import com.comet.opik.infrastructure.db.TransactionTemplateAsync;
import com.comet.opik.utils.JsonUtils;
import com.comet.opik.utils.TemplateUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Preconditions;
import com.google.inject.ImplementedBy;
Expand Down Expand Up @@ -42,6 +40,7 @@
import java.util.UUID;
import java.util.stream.Collectors;

import static com.comet.opik.api.ErrorInfo.ERROR_INFO_TYPE;
import static com.comet.opik.api.Trace.TracePage;
import static com.comet.opik.api.TraceCountResponse.WorkspaceTraceCount;
import static com.comet.opik.domain.AsyncContextUtils.bindUserNameAndWorkspaceContext;
Expand Down Expand Up @@ -929,8 +928,7 @@ private Publisher<Trace> mapToDto(Result result) {
: row.get("total_estimated_cost", BigDecimal.class))
.errorInfo(Optional.ofNullable(row.get("error_info", String.class))
.filter(str -> !str.isBlank())
.map(errorInfo -> JsonUtils.readValue(errorInfo, new TypeReference<ErrorInfo>() {
}))
.map(errorInfo -> JsonUtils.readValue(errorInfo, ERROR_INFO_TYPE))
.orElse(null))
.createdAt(row.get("created_at", Instant.class))
.lastUpdatedAt(row.get("last_updated_at", Instant.class))
Expand Down

0 comments on commit 5f81fa0

Please sign in to comment.