-
Notifications
You must be signed in to change notification settings - Fork 868
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
Make Schema::fields
and Schema::metadata
pub
(public)
#2239
Conversation
@@ -33,11 +33,11 @@ use super::Field; | |||
/// memory layout. | |||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] | |||
pub struct Schema { | |||
pub(crate) fields: Vec<Field>, | |||
pub fields: Vec<Field>, |
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.
This is the entire change -- make these two fields pub
Codecov Report
@@ Coverage Diff @@
## master #2239 +/- ##
=======================================
Coverage 82.30% 82.31%
=======================================
Files 241 242 +1
Lines 62437 62446 +9
=======================================
+ Hits 51389 51400 +11
+ Misses 11048 11046 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. |
/// outside of the arrow crate | ||
|
||
#[test] | ||
fn schema_destructure() { |
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.
- Add a test outside the crate to use that
Do we need to move outside the tests of other public members to make sure they can be used outside the arrow crate?
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.
Do we need to move outside the tests of other public members to make sure they can be used outside the arrow crate?
If we have such tests then yes I think they need to be outside the crate. In general, actually, moving some of the arrow testing into separate integration tests might be good for the compile/test/change cycle.
However, I don't think we should go overboard and try to write tests for all pub
fields -- I felt this was in particular special (mostly because I don't want someone in the future to remove the pub
thinking it won't affect anyone)
Benchmark runs are scheduled for baseline = 99ad915 and contender = 3032a52. 3032a52 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
🎉 |
Filed #2262 to track 'one metadata type' |
Which issue does this PR close?
Closes #1091
(I will file a follow on ticket to make the metadata type handling uniform between
Schema
andField
)Rationale for this change
Whenever working with
Schema
(e.g. project, etc) I often find myself having toclone()
fields
andmetadat
which is:This most recently happened to me on this PR like apache/datafusion#2985
@jorgecarleitao and I discussed various options on #1091 and he suggested that that making members of
Schema
pub
would be good as he astutely observed thatWhat changes are included in this PR?
Schema
fields pubAre there any user-facing changes?
Fields are pub 🎉
Alternates considered
I also considered making a function like the following to allow destructuring the
Schema
And this would satisfy my usecase and I am happy to do this instead if reviewers prefer.
After I reread #1091 I decided I would propose the 'make things pub' first and see what I reaction I got.
cc @nevi-me @seddonm1 @tustvold @HaoYang670 @andygrove @viirya