-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[OPIK-7891] [BE] fix: count distinct item ids when sizing a dataset version #7966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
195912d
[OPIK-7891] [BE] fix: count distinct item ids when sizing a dataset v…
petros-double-test1 50aa19a
refactor(datasets): count the same id field the insert binds
petros-double-test1 98b8482
test(datasets): assert the surviving rows, not just how many
petros-double-test1 23ac017
[NA] [DOCS] docs: warn against bare hasSize in collection assertions
petros-double-test1 77a681e
test(datasets): drop the nondeterministic duplicate-winner assertion
petros-double-test1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only should reuse the constant, many times there's an existing helper method or even helper class which should be used (generally delegates to the constant). That way we keep the assertions logic centralised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed — and the point generalises past the constant. Tracked as OPIK-8181 so this PR can merge without growing further.
The dataset item tests are the clearest instance:
IGNORED_FIELDS_DATA_ITEMis declared twice (DatasetsResourceTest:219and, independently,ExperimentAggregatesIntegrationTest:130),DatasetVersionResourceTestimports it across package boundaries from a sibling resource test class, and ~10 call sites repeat the comparator chain by hand. Two copies of the list can drift silently.The follow-up extracts a
DatasetItemAssertionsunderapi/resources/utils/mirroringTraceAssertions, migrates the call sites, and reworks the skill-doc guidance to say helper-method-or-class over inlined constant. Doing it in a separate PR rather than here because it touches three large test classes and needs the two constant declarations diffed and reconciled deliberately — that reconciliation is its own reviewable decision, not a drive-by in a counter-correctness fix.Note the
hasSizedoc section this thread is anchored on is no longer on the branch; restoring it, phrased around helper reuse, is part of the follow-up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JetoPistola as general feedback, let's not create a ticket for small follow-up comments like this.
We send the PR or not, but as part of the same tickets.
We can't maintain a backlog of PR follow-up tickets, it's too much burden. In addition, it's not the purpose of the backlog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrescrz - thanks for the feedback, appreciate it
Agreed - we shouldn't overload the backlog, especially with PR follow-up tickets (Like this comment) - avoiding ticket bloat, makes sense.
Perhaps my main concern was that touching three large test classes and reconciling the constant drift felt a bit too heavy for a drive-by change, in this correctness PR
That said, there were alternative approaches for me to take:
This time, already spun the jira ticket. Future wise - hope that will adjust the workflow, to keep things leaner