Skip to content

Commit

Permalink
Find format from filename, not filepath (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 authored Jul 9, 2024
1 parent 10d178b commit 456d996
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dags/oaebu_workflows/onix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def _save_metadata(self, metadata: Union[List[dict], Mapping[str, Any]], file_pa
self._current_md_path = file_path

def _load_metadata(self, file_path: str):
format = re.search(r"\.(.*)$", file_path).group(1)
fname = file_path.split("/")[-1]
format = re.search(r"\.(.*)$", fname).group(1)
if format == "xml":
with open(file_path, "rb") as f:
metadata = xmltodict.parse(f)
Expand Down

0 comments on commit 456d996

Please sign in to comment.