Skip to content
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

DM-40381: Deduplicate when merging DatastoreRecordData and document preconditions. #879

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Aug 16, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@TallJimbo TallJimbo marked this pull request as ready for review August 16, 2023 20:58
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.01% ⚠️

Comparison is base (41038f7) 87.71% compared to head (363042d) 87.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
- Coverage   87.71%   87.70%   -0.01%     
==========================================
  Files         274      274              
  Lines       36107    36108       +1     
  Branches     7552     7553       +1     
==========================================
  Hits        31670    31670              
  Misses       3264     3264              
- Partials     1173     1174       +1     
Files Changed Coverage Δ
python/lsst/daf/butler/core/datastore.py 94.80% <ø> (ø)
python/lsst/daf/butler/core/datastoreRecordData.py 85.88% <50.00%> (-1.03%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

Looks okay once I realized that the idea here is that there are fully populated subsets of DatastoreRecordData floating around and when you call update you are noting that, assuming these are all from the same datastore, that if one record for a dataset_id is already present there is no need to copy over the records from the incoming object. If there is a mismatch in definitions for that record we have bigger problems.

Ideally DatastoreRecordData would have some idea about the primary keys that StoredDatastoreItemsInfo could report to it.

@TallJimbo
Copy link
Member Author

Looks okay once I realized that the idea here is that there are fully populated subsets of DatastoreRecordData floating around and when you call update you are noting that, assuming these are all from the same datastore, that if one record for a dataset_id is already present there is no need to copy over the records from the incoming object. If there is a mismatch in definitions for that record we have bigger problems.

Yes, that's exactly it.

Ideally DatastoreRecordData would have some idea about the primary keys that StoredDatastoreItemsInfo could report to it.

For our current limited use cases for this export API (i.e. just QBB), I like keeping DatastoreRecordData being unaware of the real primary key, and just declaring that only full datasets (not components) can be exported this way. It's a lot simpler than any alternative I can think of, and I can't think of a scenario where it'd be a serious limitation.

@TallJimbo TallJimbo merged commit 87d628b into main Aug 18, 2023
14 of 16 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-40381 branch August 18, 2023 14:45
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.

None yet

2 participants