Skip to content

Commit 5d8f3fc

Browse files
committed
Merge branch 'krivard/covid_hosp-facility-running-time' of github.com:cmu-delphi/delphi-epidata into krivard/covid_hosp-facility-running-time
2 parents 221e53d + 2544fa3 commit 5d8f3fc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/acquisition/covid_hosp/common/database.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ def nan_safe_dtype(dtype, value):
211211
many_values = []
212212
except Exception as e:
213213
if logger:
214-
logger.info('error on insert', index=index, values=values)
215-
logger.error(e)
214+
logger.error('error on insert', publ_date=publication_date, in_lines=(n-5_000, n), index=index, values=values, exception=e)
216215
raise e
217216
# insert final batch
218217
if many_values:

src/acquisition/covid_hosp/common/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ def limited_string(value):
7979
return limited_string
8080

8181
GEOCODE_LENGTH = 32
82-
GEOCODE_PATTERN = re.compile(r'POINT \(([0-9.-]*) ([0-9.-]*)\)')
82+
GEOCODE_PATTERN = re.compile(r'POINT \((-?[0-9.]+) (-?[0-9.]+)\)')
8383
def limited_geocode(value):
8484
if len(value) < Utils.GEOCODE_LENGTH:
8585
return value
86-
# otherwise parse and reduce precision to 5
86+
# otherwise parse and set precision to 6 decimal places
8787
m = Utils.GEOCODE_PATTERN.match(value)
8888
if not m:
8989
raise CovidHospException(f"Couldn't parse geocode '{value}'")
90-
return f'POINT ({" ".join(map(lambda x: f"{float(x):.6f}", m.groups()))})'
90+
return f'POINT ({" ".join(f"{float(x):.6f}" for x in m.groups())})'
9191

9292
def issues_to_fetch(metadata, newer_than, older_than, logger=False):
9393
"""

0 commit comments

Comments
 (0)