Skip to content

Commit

Permalink
Reject null file_id in TDR snapshots (#2579, PR #2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-ucsc committed Dec 10, 2020
2 parents d991426 + 2a76380 commit f209dd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/azul/plugins/repository/tdr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
RequirementError,
cached_property,
config,
reject,
require,
)
from azul.bigquery import (
Expand Down Expand Up @@ -570,8 +571,8 @@ def _parse_file_id_column(self, file_id: Optional[str]) -> Optional[str]:
# The file_id column is present for datasets, but is usually null, may
# contain unexpected/unusable values, and NEVER produces usable DRS URLs,
# so we avoid parsing the column altogether for datasets.
# Some developmental snapshots also expose null file_ids.
if self.source.is_snapshot and file_id is not None:
if self.source.is_snapshot:
reject(file_id is None)
# TDR stores the complete DRS URI in the file_id column, but we only
# index the path component. These requirements prevent mismatches in
# the DRS domain, and ensure that changes to the column syntax don't
Expand Down

0 comments on commit f209dd1

Please sign in to comment.