-
Notifications
You must be signed in to change notification settings - Fork 892
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
fix: invalid examples/documentation in parquet_derive doc #5823
Conversation
Perhaps we could change |
7917561
to
a66cd13
Compare
ba9f319
to
604da73
Compare
parquet_derive/src/lib.rs
Outdated
@@ -160,6 +167,7 @@ pub fn parquet_record_writer(input: proc_macro::TokenStream) -> proc_macro::Toke | |||
/// | |||
/// pub fn read_some_records() -> Vec<ACompleteRecord> { | |||
/// let mut samples: Vec<ACompleteRecord> = Vec::new(); | |||
/// let mut file = tempfile().unwrap(); |
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.
/// let mut file = tempfile().unwrap(); | |
/// let mut file = todo!(); |
And same above, would avoid a dependency
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 does not work.
error[E0277]: the trait bound `(): std::io::Write` is not satisfied
--> parquet_derive/src/lib.rs:73:19
|
34 | let mut writer = SerializedFileWriter::new(file, schema, Default::default()).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `()`
|
note: required by a bound in `SerializedFileWriter`
--> /Users/hwj/Desktop/rust/arrow-rs/parquet/src/file/writer.rs:141:36
|
141 | pub struct SerializedFileWriter<W: Write> {
| ^^^^^ required by this bound in `SerializedFileWriter`
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.
I use std::fs::File
to avoid a dependency
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.
Just a minor nit
parquet_derive/src/lib.rs
Outdated
@@ -160,6 +167,7 @@ pub fn parquet_record_writer(input: proc_macro::TokenStream) -> proc_macro::Toke | |||
/// | |||
/// pub fn read_some_records() -> Vec<ACompleteRecord> { | |||
/// let mut samples: Vec<ACompleteRecord> = Vec::new(); | |||
/// let mut file = File::open("some_file.parquet").unwrap(); |
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.
I suspect the mut is unnecessary
parquet_derive/src/lib.rs
Outdated
@@ -62,14 +66,15 @@ mod parquet_field; | |||
/// a_str: "I'm false" | |||
/// } | |||
/// ]; | |||
/// let mut file = File::open("some_file.parquet").unwrap(); |
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.
I suspect the mut is unnecessary
Which issue does this PR close?
Closes #5687
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?