fix: Only treat PathBuf ending parts that match one of our extensions as file names

pull/24376/head
Carol (Nichols || Goulding) 2021-01-14 16:32:55 -05:00
parent 25cc396f5e
commit 0415d4a186
1 changed files with 8 additions and 1 deletions

View File

@ -330,7 +330,14 @@ impl From<PathRepresentation> for DirsAndFileName {
.collect();
let maybe_file_name = match parts.pop() {
Some(file) if file.0.contains('.') => Some(file),
Some(file)
if !file.0.starts_with('.')
&& (file.0.ends_with(".json")
|| file.0.ends_with(".parquet")
|| file.0.ends_with(".segment")) =>
{
Some(file)
}
Some(dir) => {
parts.push(dir);
None