-
Notifications
You must be signed in to change notification settings - Fork 5
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
Proptest for checking correctness of a single sparse write #103
Conversation
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.
+1
self.capi_call(|ctx| unsafe { | ||
ffi::tiledb_array_schema_get_allows_dups( |
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.
Whoops
let schema_version = s.version().unwrap(); | ||
|
||
// it's a little awkward to use a constant here but this does | ||
// not appear to be tied to the library version |
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.
Correct. The schema version is actually the underlying data format which is incremented anytime we change how something is stored on disk. You can find the mapping of storage format versions to library versions here:
/// Test what the default values filled in for `None` with schema data are. | ||
/// Mostly because if we write code which does need the default, we're expecting | ||
/// to match core and need to be notified if something changes or we did something | ||
/// wrong. |
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.
Excellent idea!
…ry-proptest-sparse
This is the follow-up to #98 , extending the proptest to also work correctly for sparse writes.
Things this pull request had to deal with:
There are a few notable tools used to accomplish these goals.
As we've been building out the API we've had more and more reasons to separate handling of floating-point types from integral types for the various enums that can hold both. This pull request encounters yet another, and so we add the
crate::datatype::Integral
trait as a helper for writing generic code over u8, u16, u32, etc.Another tool added here is an analog of
Iterator::map
for the query callback adapters. We addmap_intermediate
,map_final
, andmap
functions for transforming the result of a callback into something else.