From f98f1df9fbadfb7310715b3d06cdbd95ae15ccfa Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Fri, 13 Oct 2023 09:04:58 -0700 Subject: [PATCH] adding tzinfo if missing from passed call --- caveclient/chunkedgraph.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/caveclient/chunkedgraph.py b/caveclient/chunkedgraph.py index 71dc761b..053a1024 100644 --- a/caveclient/chunkedgraph.py +++ b/caveclient/chunkedgraph.py @@ -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(