feat(xpansion): db dao de-normalized version#3089
Closed
Conversation
9792d82 to
d212dd7
Compare
smailio
commented
Mar 9, 2026
| insert(XPANSION_SENSITIVITY_PROJECTION_TABLE), | ||
| [{"study_id": self._study_id, "candidate_name": name} for name in sensitivity["projection"]], | ||
| ) | ||
| except IntegrityError: |
Collaborator
Author
There was a problem hiding this comment.
The file study doesn't handle this validation.
In the denormalized version I don't perform the validation.
However, In the normalized version the validation is enforced by the DB, I could ignore the IntegrityError just to align with the file stufy implementation but I think that would be unwise.
Btw, the IntegrityError can be triggered both by duplicates projections lines or missing candidates, however in this PR I added validation at the model level for duplicates so we're sure at this stage of the code that if the IntegrityError it can only be the missing candidate.
…-xpansion-denormalized
…-xpansion-denormalized
…-xpansion-denormalized
…-xpansion-denormalized
Member
|
We kept the normalized version, closing ! |
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.
This implementation has better perf and is less complex than the normalized implementation.
However even if the denormalized version seems relatively faster it's at most one ms faster than the normalized one. For such small gains I'd recommend to go with the normalized version.