Skip to content

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented Jun 19, 2025

The VectorStore#similaritySearch methods never return null. There is a data flow issue in the AbstractObservationVectorStore. However, that's only because Micrometer Observation#observe is marked as @Nullable, but the value returned is actually the value that the passed supplier returns, which is on control of Spring AI and is never null

The VectorStore#similaritySearch methods never return null.
There is a data flow issue in the AbstractObservationVectorStore.
However, that's only because Micrometer Observation#observe is marked as `@Nullable`,
but the value returned is actually the value that the passed supplier returns, which is on control of
Spring AI and is never null

Signed-off-by: Filip Hrisafov <[email protected]>
@sobychacko sobychacko added this to the 1.1.x milestone Jun 25, 2025
@sobychacko sobychacko merged commit 64cf88a into spring-projects:main Jun 25, 2025
2 checks passed
spring-builds pushed a commit that referenced this pull request Jun 25, 2025
The VectorStore#similaritySearch methods never return null, but there's
a data flow issue in AbstractObservationVectorStore caused by Micrometer's
Observation#observe being marked as @nullable. The returned value is
actually controlled by Spring AI's supplier, which never returns null.

Fixes #3613

Signed-off-by: Filip Hrisafov <[email protected]>
(cherry picked from commit 64cf88a)
@filiphr filiphr deleted the vector-store-nullable branch July 9, 2025 20:22
scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
…#3613)

The VectorStore#similaritySearch methods never return null, but there's
a data flow issue in AbstractObservationVectorStore caused by Micrometer's
Observation#observe being marked as @nullable. The returned value is
actually controlled by Spring AI's supplier, which never returns null.

Fixes spring-projects#3613
Auto-cherry-pick to 1.0.x

Signed-off-by: Filip Hrisafov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants