Skip to content

Commit

Permalink
adding tzinfo if missing from passed call
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Oct 13, 2023
1 parent c6f1681 commit f98f1df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,12 @@ def get_latest_roots(self, root_id, timestamp=None, timestamp_future=None):
if timestamp_future is not None:
logger.warning("timestamp_future is deprecated, use timestamp instead")
timestamp = timestamp_future

if timestamp is None:
timestamp = datetime.datetime.now(datetime.timezone.utc)

elif timestamp.tzinfo is None:
timestamp = timestamp.replace(tzinfo=datetime.timezone.utc)

# or if timestamp_root is less than timestamp_future
if (timestamp is None) or (timestamp_root < timestamp):
lineage_graph = self.get_lineage_graph(
Expand Down

0 comments on commit f98f1df

Please sign in to comment.