Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bossie committed Sep 12, 2024
1 parent 465b233 commit 1f251f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openeogeotrellis/geopysparkcubemetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(
spatial_extent: dict = None, temporal_extent: tuple = None
):
super().__init__(metadata=metadata, dimensions=dimensions)
# TODO: why do we need these in addition to those in dimensions?
self._spatial_extent = spatial_extent
self._temporal_extent = temporal_extent
if self.has_temporal_dimension() and temporal_extent is not None:
Expand Down Expand Up @@ -67,6 +68,9 @@ def spatial_extent(self) -> dict:

def filter_temporal(self, start, end) -> 'GeopysparkCubeMetadata':
"""Create new metadata instance with temporal extent"""
if self._temporal_extent is None: # TODO: only for backwards compatibility
return self._clone_and_update(temporal_extent=(start, end))

this_start, this_end = map(dateutil.parser.parse, self._temporal_extent)
that_start, that_end = map(dateutil.parser.parse, (start, end))

Expand Down

0 comments on commit 1f251f0

Please sign in to comment.