fix: enforce unique id column values in input dataclasses - #228
Open
frayle-ons wants to merge 1 commit into
Open
fix: enforce unique id column values in input dataclasses#228frayle-ons wants to merge 1 commit into
frayle-ons wants to merge 1 commit into
Conversation
…rors in servers module for dataclass validation
frayle-ons
marked this pull request as ready for review
September 2, 2026 11:15
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.
resolves #167
✨ Summary
These changes modify the Pandera schemas of the input dataclasses to ensure that the user doesn't supply dataclasses with non-unique id column values. Non unique values in this case adversely affect data processing in the package because the codebase relies on
df.groupby('id')statements which assume that the 'id' column has unique values.I've added
unique=Trueto each of the input dataclass' pandera schemasidcolmumn specifications. I've also included a servers module update, to catch and raise Pandera validation errors when JSON body information is converted to dataclass input objects, ensuring users know when a specific Pandera issue arises behind the base Pydantic validation.(Below) An example screenshot passing non-unique IDs to a VectorStore

reverse_search()endpoint📜 Changes Introduced
✅ Checklist
Code passes all pre-commit checks, including optional Docker secret checker step.
🔍 How to Test
Below is a simple startup script, using fake data from the ClassifAI repo, that will run a server which the user can pass JSON requests to each endpoint to see the new changes in actions:
The final line of code starts a RESTful API service. It would also be good to call the VectorStore methods programatically in Python instead of over a network. See below some example Python code that could be included in the above script replacing the line which runs the server.
For the search method:
For the reverse_search method:
For the embed method:
The above examples can also be applied to the REST API testing.