Skip to content

Fix bug preventing Qdrant points with numeric id from being consumed - #1075

Merged
Lee Miller (lemillermicrosoft) merged 2 commits into
microsoft:mainfrom
craigomatic:qdrant-support-both-int-and-string-ids
May 18, 2023
Merged

Lee Miller (lemillermicrosoft) merged 2 commits into
microsoft:mainfrom
craigomatic:qdrant-support-both-int-and-string-ids

Conversation

@craigomatic

Copy link
Copy Markdown
Contributor

Motivation and Context

Qdrant supports both string and int for the id of a ScoredPoint. This minor change allows the serialiser to handle both of these scenarios while retaining string as the type for SK.

Thank you to 于斯人也 (@AwesomeYuer) for the heads up in #794

Description

Added a single attribute decorating the attribute that massages ints to string and leaves string as-is.

Contribution Checklist

…tion (Qdrant allows either string or int for this Id)
@craigomatic Craig Presti (craigomatic) added PR: ready for review All feedback addressed, ready for reviews memory connector labels May 18, 2023
@github-actions github-actions Bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels May 18, 2023

@tawalke Tara W (tawalke) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an effective and efficient solution for this!

@craigomatic Craig Presti (craigomatic) added PR: ready to merge PR has been approved by all reviewers, and is ready to merge. and removed PR: ready for review All feedback addressed, ready for reviews labels May 18, 2023
@lemillermicrosoft
Lee Miller (lemillermicrosoft) merged commit 6a1c4ef into microsoft:main May 18, 2023
Shawn Callegari (shawncal) pushed a commit to johnoliver/semantic-kernel that referenced this pull request May 19, 2023
…icrosoft#1075)

### Motivation and Context
Qdrant supports both string and int for the id of a ScoredPoint. This
minor change allows the serialiser to handle both of these scenarios
while retaining string as the type for SK.

Thank you to @AwesomeYuer for the heads up in microsoft#794 

### Description
Added a single attribute decorating the attribute that massages ints to
string and leaves string as-is.
@AwesomeYuer

Copy link
Copy Markdown

glad to hear that

@EachShow

EachShow commented Jun 2, 2023

Copy link
Copy Markdown

when call the function "kernel.Memory.SaveInformationAsync", the ID is assigned to a GUID,
then call the function "IQdrantVectorDbClient.GetVectorByPayloadIdAsync", an error will occur

Starting in .NET 6, if you apply JsonNumberHandlingAttribute to a property that's a collection of non-number values and attempt to serialize or deserialize the property, an InvalidOperationException is thrown.

Adrian Bonar (adrianwyatt) pushed a commit that referenced this pull request Jun 2, 2023
### Motivation and Context
This PR fixes a regression introduced in #1075 and includes unit tests
to correctly validate that both string and integer property ids are
supported.

### Description
The changes are based on the code suggested by AwesomeYuer over in #794
- the JsonNumberHandling attribute behaved in an unexpected way and was
removed.
hyunyoungjin (salmon131) pushed a commit to salmon131/semantic-kernel that referenced this pull request Jun 3, 2023
…oft#1313)

### Motivation and Context
This PR fixes a regression introduced in microsoft#1075 and includes unit tests
to correctly validate that both string and integer property ids are
supported.

### Description
The changes are based on the code suggested by AwesomeYuer over in microsoft#794
- the JsonNumberHandling attribute behaved in an unexpected way and was
removed.
@craigomatic
Craig Presti (craigomatic) deleted the qdrant-support-both-int-and-string-ids branch June 15, 2023 23:26
Shawn Callegari (shawncal) pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
…oft#1313)

### Motivation and Context
This PR fixes a regression introduced in microsoft#1075 and includes unit tests
to correctly validate that both string and integer property ids are
supported.

### Description
The changes are based on the code suggested by AwesomeYuer over in microsoft#794
- the JsonNumberHandling attribute behaved in an unexpected way and was
removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel memory connector .NET Issue or Pull requests regarding .NET code PR: ready to merge PR has been approved by all reviewers, and is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants