Skip to content

Commit

Permalink
correcting deprecated method call, tidying up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed Jul 24, 2024
1 parent b189fdc commit 27f5735
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/pg_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Author: Phil Owen, RENCI.org
"""
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
import dateutil.parser
import pytz
import pandas as pd
Expand Down Expand Up @@ -63,7 +63,7 @@ def get_terria_map_workbench_data(self, **kwargs):
# init the return
ret_val: dict = {}

# if there was a run id specified in the request we are returning a workbench for only that run
# if there was a run id specified in the request, we are returning a workbench for only that run
if 'run_id' in kwargs and kwargs['run_id'] != 'null':
# get the catalog members for the run using the id
sql = f"SELECT public.get_catalog_workbench(_run_id:='{kwargs['run_id']}')"
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_terria_map_workbench_data(self, **kwargs):
if item['met_class'] == 'tropical':
# get the number of days from the last tropical run to now
insertion_date = dateutil.parser.parse(item['insertion_date'])
date_diff = pytz.utc.localize(datetime.utcnow()) - insertion_date
date_diff = pytz.utc.localize(datetime.now(tz=timezone.utc)) - insertion_date

# is this young enough?
if date_diff.days < max_age:
Expand Down Expand Up @@ -146,7 +146,7 @@ def get_terria_map_catalog_data(self, **kwargs):

# should we continue?
if not ('Error' in workbench_data or 'Warning' in workbench_data):
# if the run id was specified use it. this also disables using the new workbench code
# if the run id was specified, use it. this also disables using the new workbench code
if 'run_id' in kwargs and kwargs['run_id'] != 'null':
wb_sql = f", _run_id:='{kwargs['run_id']}'"
# if there was workbench data, use it in the data query
Expand Down

0 comments on commit 27f5735

Please sign in to comment.