-
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
Add proptest strategies for generating Dimension, a bunch of Debug impls, and even some arrow stuff #15
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.
Awesome work. Most of my comments were just style related. Overall its great though. The only thing I'd say to change is copying your PR comment next to that big macro definition since it really does help clarify what's going on there.
@@ -0,0 +1,65 @@ | |||
use tiledb::context::Context as TileDBContext; | |||
use tiledb::Result as TileDBResult; |
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.
We should probably get a PR up so that all of our important things are importable wiht a statement like:
use tiledb::{TileDBArray, TileDBContext, TileDBQuery, TileDBResult};
proptest!(|(attr in tiledb_test::attribute::arbitrary(&c))| { | ||
if let Some(arrow_field) = arrow_field(&attr).expect("Error reading tiledb attribute") { | ||
assert_eq!(attr.name()?, *arrow_field.name()); | ||
assert!(crate::datatype::is_same_physical_type(&attr.datatype()?, arrow_field.data_type())); |
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.
Hurms. Still more wonky lack of indentation. Perhaps this is because of the enclosing macro? I've verified locally that this is what rustfmt gives.
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.
It definitely seems like rustfmt doesn't know what to do with macros
This is what fell out of me working on the Arrow schema conversion functions. I wanted to do PBT for them, but that means we have to have strategies to generate Schema, which requires Domain, which requires Dimension, and maybe more!
So this pull request ends up being mostly test stuff with a little bit of arrow.
A few notable things:
fn_typed
which emulates the same function we have in C++LifetimeStrategy
struct which works around usingfn_typed
in a strategy and also having a non-static lifetime due to needing the&'ctx tiledb::context::Context
Debug
impls I added useserde_json
to format their results