Skip to content

Commit

Permalink
Return None, rather than stopping.
Browse files Browse the repository at this point in the history
  • Loading branch information
dunkgray committed Jan 30, 2020
1 parent b5fa117 commit 0b65a88
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions eodatasets3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,15 @@ def producer_abbreviated(self) -> Optional[str]:
@property
def datatake_sensing_time(self) -> Optional[str]:
"""datatake_sensing_time"""
datatake_sensing_time = None
if "sentinel:sentinel_tile_id" in self.dataset.properties:
tile_id = self.dataset.properties.get("sentinel:sentinel_tile_id")
split_tile_id = tile_id.split('_')
assert len(split_tile_id) >= 7
return split_tile_id[-4]
else:
return None
try:
datatake_sensing_time = split_tile_id[-4]
except IndexError:
pass
return datatake_sensing_time

@attr.s(auto_attribs=True, slots=True)
class DatasetDoc(EoFields):
Expand Down

0 comments on commit 0b65a88

Please sign in to comment.