Skip to content

Commit

Permalink
Erroring at the rust level instead of overriding source
Browse files Browse the repository at this point in the history
  • Loading branch information
Whattabatt committed Oct 3, 2024
1 parent 259c4d9 commit 6c3ba6c
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/deduper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,24 @@ fn write_attributes(
);
}

let document_key = dedupe_config
.document_dir
.unwrap_or(String::from("documents"));

let attrs_location = {
let attr_prefix = format!("/attributes/{}/", attr_key);
docs_location.replace(
&format!(
"/{}/",
dedupe_config
.document_dir
.unwrap_or(String::from("documents"))
),
&attr_prefix,
)
docs_location.replace(&format!("/{}/", &document_key), &attr_prefix)
};

if attrs_location == docs_location {
log::error!(
"{} does not contain {} . Not writing its attributes!",
docs_location,
&document_key
);
panic!("Attribtue would be written to document location");
}

let local_output = cache.prepare_output(&attrs_location, label_temp)?;
let mut num_processed = 0;
let mut num_observed = 0;
Expand Down

0 comments on commit 6c3ba6c

Please sign in to comment.