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-32883: Support StorageClass conversion on get. #615
Conversation
8403ba6
to
c68f4b8
Compare
Codecov Report
@@ Coverage Diff @@
## main #615 +/- ##
==========================================
+ Coverage 83.96% 84.05% +0.08%
==========================================
Files 234 234
Lines 30036 30166 +130
Branches 4976 4995 +19
==========================================
+ Hits 25221 25356 +135
+ Misses 3669 3666 -3
+ Partials 1146 1144 -2
Continue to review full report at Codecov.
|
937657f
to
91edc42
Compare
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.
Looks good, couple of minor comments.
This allows a storage class to declare that it can convert some python types into the python type of that storage class.
If an incorrect python type is returned from the formatter it is possible to make a last ditch attempt to morph it to the required python type.
With storage class conversion now supported the code can no longer assume that the write storage class is going to match the read storage class. Change _coerceType to understand by storage classes and to allow python type coercion to the read storage class after coercion to the write storage class.
91edc42
to
8b07fa4
Compare
Properly test for bad converter exception.
This allows a converter to be registered with a storage class that will be run if the dataset read from the datastore has an incorrect type that can be converted to the expected one.
Checklist
doc/changes