-
Notifications
You must be signed in to change notification settings - Fork 289
feat(spec): Expose DataFile serde functions #1563
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
base: main
Are you sure you want to change the base?
Conversation
"referenced_data_file": null, | ||
"content_offset": null, | ||
"content_size_in_bytes": null | ||
}); |
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.
After some tinkering, I think using serde_json::Value
to check the json output gives the most readable test.
Also I found a tricky corner case: DataFile
's serializer won't preserve the order of DataFile
's array like column_sizes
. Right now I just make the array sizes to be one to work around that, maybe there is a better solution?
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.
Also I found a tricky corner case: DataFile's serializer won't preserve the order of DataFile's array like column_sizes. Right now I just make the array sizes to be one to work around that, maybe there is a better solution?
I guess the randomness comes from HashMap
, but since now you use serde_json::Value
to do the check, I guess the order doesn't matter?
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.
Seems it still matters in below outtput. One approach is to change this function to make it determined:
#[cfg(test)]
// sort the keys.
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.
Thanks @CTTY for this PR, generally looks good!
"referenced_data_file": null, | ||
"content_offset": null, | ||
"content_size_in_bytes": null | ||
}); |
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.
Also I found a tricky corner case: DataFile's serializer won't preserve the order of DataFile's array like column_sizes. Right now I just make the array sizes to be one to work around that, maybe there is a better solution?
I guess the randomness comes from HashMap
, but since now you use serde_json::Value
to do the check, I guess the order doesn't matter?
"referenced_data_file": null, | ||
"content_offset": null, | ||
"content_size_in_bytes": null | ||
}); |
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.
Seems it still matters in below outtput. One approach is to change this function to make it determined:
#[cfg(test)]
// sort the keys.
Which issue does this PR close?
What changes are included in this PR?
DataFileSerde::try_from
take inFormatVersion
directlyAre these changes tested?
Added uts