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-33493: Add serialization support for datastore records #677

Merged
merged 3 commits into from Apr 21, 2022

Conversation

andy-slac
Copy link
Contributor

@andy-slac andy-slac commented Apr 12, 2022

Adds a bunch of pydantic classes for datastore records and implements
serialization of the records in Quantum class. I switched back
QuantumProvenanceData to be a pydantic model to use the same pydantic
classes for datastore records. Moved DatastoreRecordData class (and its
pydantic friend) to a separate module, for some reason pydantic was not
happy when I added SerializedDatastoreRecordData class to the
datastore module.

Checklist

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

@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #677 (9dcbcbb) into main (34ba32b) will decrease coverage by 0.02%.
The diff coverage is 88.00%.

@@            Coverage Diff             @@
##             main     #677      +/-   ##
==========================================
- Coverage   84.32%   84.29%   -0.03%     
==========================================
  Files         242      243       +1     
  Lines       31055    31089      +34     
  Branches     5219     5235      +16     
==========================================
+ Hits        26187    26208      +21     
- Misses       3706     3714       +8     
- Partials     1162     1167       +5     
Impacted Files Coverage Δ
python/lsst/daf/butler/core/datastore.py 73.91% <66.66%> (-0.62%) ⬇️
python/lsst/daf/butler/core/quantum.py 87.26% <77.77%> (-0.49%) ⬇️
python/lsst/daf/butler/core/datastoreRecordData.py 81.94% <81.94%> (ø)
python/lsst/daf/butler/datastores/fileDatastore.py 80.60% <93.75%> (-0.03%) ⬇️
python/lsst/daf/butler/_quantum_backed.py 89.20% <96.96%> (-0.68%) ⬇️
python/lsst/daf/butler/core/__init__.py 100.00% <100.00%> (ø)
python/lsst/daf/butler/core/storedFileInfo.py 85.91% <100.00%> (ø)
tests/test_datastore.py 99.63% <100.00%> (-0.01%) ⬇️
tests/test_quantumBackedButler.py 98.32% <100.00%> (-0.13%) ⬇️
...hon/lsst/daf/butler/registry/interfaces/_bridge.py 72.36% <0.00%> (+1.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34ba32b...9dcbcbb. Read the comment docs.

python/lsst/daf/butler/core/quantum.py Show resolved Hide resolved
python/lsst/daf/butler/core/storedFileInfo.py Outdated Show resolved Hide resolved
Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

Looks good! I have some minor comments that I think should be addressed, but the big picture looks great.

python/lsst/daf/butler/core/datastoreRecordData.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/core/datastoreRecordData.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/core/datastoreRecordData.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/core/datastoreRecordData.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
Adds a bunch of pydantic classes for datastore records and implements
serialization of the records in `Quantum` class. I switched back
`QuantumProvenanceData` to be a pydantic model to use the same pydantic
classes for datastore records. Moved `DatastoreRecordData` class (and its
pydantic friend) to a separate module, for some reason pydantic was not
happy when I added `SerializedDatastoreRecordData` class to the
`datastore` module.
Dropped `dataset_ids` member in favor of `records` keys. Dropped support
for strings vs. UUIDs in a regular constructor, strings are only
supported in direct() method. QuantumProvenanceData class had to add
direct() method to enable construction from JSON data.
@andy-slac andy-slac merged commit b7ebdee into main Apr 21, 2022
@andy-slac andy-slac deleted the tickets/DM-33493 branch April 21, 2022 02:27
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

3 participants