-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
improve file path validation when reading parquet #8267
Conversation
let file_path = path.as_str(); | ||
if (!file_path.ends_with(option_extension.clone().as_str()) | ||
&& !path.is_collection()) | ||
|| (!file_path.ends_with((option_extension.clone() + "/").as_str()) |
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.
The path separator here is platform-specific.
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.
You could use std::path::MAIN_SEPARATOR
instead here
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 @Weijun-H for a quick turnaround. Please add a test for double dots
bbb..bbb/filename.parquet
@@ -138,10 +138,10 @@ mod tests { | |||
Ok(()) | |||
} | |||
|
|||
#[cfg(not(target_family = "windows"))] |
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.
extend to all platforms
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 @Weijun-H
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.
lgtm thanks @Weijun-H
Which issue does this PR close?
Follow #8265
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?