Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
임베딩 리팩토링 설명 및 향후 작업 제안
변경 의도와 배경
Optional.empty()반환 이후 상위 계층에서 공통적으로 대체 로직을 타도록 설계되어 있어,전역 예외 처리 정책을 준수하도록 변환 로직을 한 곳(EmbeddingJsonConverter)으로 모았습니다.
이는 변환 예외가 전역 예외 핸들러까지 전파되어 과도한 에러 응답을 만드는 문제를 방지하려는 목적입니다.
ObjectMapper를 직접 주입해readValue/writeValueAsString을 호출하면서 try/catch, 로그 메시지, 컨텍스트 문자열 구성이 반복되고 있었습니다. EmbeddingJsonConverter는 같은 역할을 공통화해 중복을 제거하고, 동일한 로깅 포맷/컨텍스트를 유지하도록 합니다. 또한 향후 임베딩 포맷 변경 시 단일 지점만 수정하면 됩니다.log.warn을 남기거나 예외를 던졌는데, 추천이나 사용자 임베딩 계산 흐름에서는 일부 벡터가 손상되어도 나머지 데이터로 결과를 만들 수 있도록 설계되었습니다. 따라서 변환 실패를 "예측 가능한 품질 저하"로 간주하고, 변환기 내부에서 컨텍스트를 포함해 한 번만 기록하며, 상위 계층에서는 불필요한 중복 경고 로그를 남기지 않도록 조정했습니다.변경 요약
Optional.empty()를 반환하도록 구현했습니다.향후 리팩토링 제안
테스트 실패 원인
./gradlew test실행 시 Maven Central 의존성 다운로드 단계에서 HTTP 403 오류가 발생하여 테스트가 수행되지 않았습니다. 외부 네트워크 제약으로 인한 환경적 실패로, 소스 변경과 직접적인 연관은 없습니다.