Skip to content

Commit f44f167

Browse files
committed
bugfix: schema updation issue
in standalone mode, the `.schema` file from staging wasn't getting pushed to storage due to the improper usage of `path().extension()` function. It was always returning `None`. Instead of checking whether the extension is `schema`, check if the file path ends with `.schema`
1 parent 7d1d9a9 commit f44f167

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/parseable/streams.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,11 @@ impl Stream {
529529

530530
dir.flatten()
531531
.map(|file| file.path())
532-
.filter(|file| file.extension().is_some_and(|ext| ext.eq("schema")))
532+
.filter(|file| {
533+
file.file_name()
534+
.and_then(|n| n.to_str())
535+
.is_some_and(|n| n.ends_with(".schema"))
536+
})
533537
.collect()
534538
}
535539

@@ -539,8 +543,11 @@ impl Stream {
539543
let mut schemas: Vec<Schema> = Vec::new();
540544

541545
for file in dir.flatten() {
542-
if let Some(ext) = file.path().extension()
543-
&& ext.eq("schema")
546+
if file
547+
.path()
548+
.file_name()
549+
.and_then(|n| n.to_str())
550+
.is_some_and(|n| n.ends_with(".schema"))
544551
{
545552
let file = File::open(file.path())?;
546553

0 commit comments

Comments
 (0)