-
Notifications
You must be signed in to change notification settings - Fork 930
Fix Result
name collision in parquet_derive
#7548
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
Thank you for the contribution @jspaezp This code looks good to me. Is there any chance you can make a test for this (that would fail if we accidentally broke this feature)? Perhaps you could make a small |
@alamb thanks for the fast reply! I added a test (added it in parquet_derive_test/src/lib.rs rather than parquet-derive/test/macro_hygene.rs). LMK if this is what you had in mind! |
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 think we can make the test even harder. Other than that, solid fix!
parquet_derive_test/src/lib.rs
Outdated
|
||
mod aliased_result { | ||
use parquet_derive::{ParquetRecordReader, ParquetRecordWriter}; | ||
pub type Result = std::result::Result<(), Box<dyn std::error::Error>>; |
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.
pub type Result = std::result::Result<(), Box<dyn std::error::Error>>; | |
// not an actual result type | |
pub type Result = (); |
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.
Did the modification but left the other one commented out so there is a bit more historical context (hope thats ok)
parquet_derive_test/src/lib.rs
Outdated
} | ||
|
||
impl ARecord { | ||
pub fn validate(&self) -> Result { |
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.
pub fn validate(&self) -> Result { | |
pub fn validate(&self) -> std::result::Result<(), Box<dyn std::error::Error>> { |
(so it doesn't use our Result
shadow)
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.
Thank you @jspaezp and @crepererum ❤️
Which issue does this PR close?
Closes #7547
Rationale for this change
Explained in the issue.
What changes are included in this PR?
Pretty simple change from
Result
tostd::result::Result
to prevent the 'name collision' on the code/text generated from the macro.Are there any user-facing changes?
None that I can think of.
Please let me know if there is anything else you might want/need on my end! and thank you very much for this project.