Skip to content

fix: make input dataclass id column unique#168

Draft
frayle-ons wants to merge 1 commit intomainfrom
167-make-id-column-unique
Draft

fix: make input dataclass id column unique#168
frayle-ons wants to merge 1 commit intomainfrom
167-make-id-column-unique

Conversation

@frayle-ons
Copy link
Copy Markdown
Contributor

✨ Summary

If the user provides an input dataclass containing non-unique id column values to a started rest_api, the response will be malformed. This is because the internal logic for converting result dataframes to pydantic modelled json response relies on these id values being unique.

These changes add Pandera and Pydantic checks to make sure that the input data classes contain only unique id values.

📜 Changes Introduced

  • Updated the Pydantic server models to check for duplicates in id columns
  • Updated the Pandera dataclass models to check for duplicates in id columns

✅ Checklist

  • Code passes linting with Ruff
  • Security checks pass using Bandit
  • API and Unit tests are written and pass using pytest
  • Terraform files (if applicable) follow best practices and have been validated (terraform fmt & terraform validate)
  • DocStrings follow Google-style and are added as per Pylint recommendations
  • Documentation has been updated if needed

🔍 How to Test

@frayle-ons frayle-ons linked an issue Apr 13, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make ID column unique for input data classes

1 participant