Skip to content

NCHS fix removing None files #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nchs_mortality/delphi_nchs_mortality/archive_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def arch_diffs(params, daily_arch_diff):
remove(exported_file)
for exported_file, diff_file in common_diffs.items():
remove(exported_file)
remove(diff_file)
if diff_file is not None:
remove(diff_file)

# Report failures: someone should probably look at them
for exported_file in fails:
Expand Down
4 changes: 4 additions & 0 deletions nchs_mortality/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from os import listdir, remove
from os.path import join
from shutil import copy

from delphi_utils import read_params
from delphi_nchs_mortality.run import run_module
Expand All @@ -27,6 +28,9 @@ def run_as_module(date):
if ".csv" in fname:
remove(join("daily_cache", fname))

# Simulate the cache already being partially populated
copy("test_data/weekly_202025_state_wip_deaths_covid_incidence_prop.csv", "daily_cache")

for fname in listdir("daily_receiving"):
if ".csv" in fname:
remove(join("daily_receiving", fname))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
geo_id,val,se,sample_size
al,1.79475177,,
ak,0.00000000,,
az,2.80269167,,
ar,1.49115052,,
ca,1.14648064,,
co,0.65986703,,
ct,1.23412225,,
dc,3.96741605,,
fl,1.01500452,,
ga,0.88533724,,
hi,0.00000000,,
id,0.00000000,,
il,2.08336278,,
in,1.63393378,,
ia,1.01424057,,
ks,0.68650341,,
ky,0.58195844,,
la,1.82843120,,
md,2.21645868,,
ma,1.88610726,,
mi,0.57075014,,
mn,1.18802079,,
ms,2.40543506,,
mo,0.68432575,,
ne,1.18899426,,
nv,0.64931773,,
nh,0.95608552,,
nj,1.81261604,,
nm,1.19227653,,
ny,1.10519612,,
nc,0.95346300,,
oh,0.89827275,,
ok,0.45489340,,
or,0.28451276,,
pa,1.42165408,,
ri,3.11508541,,
sc,1.10707256,,
sd,1.37854660,,
tn,0.86394050,,
tx,1.03462971,,
ut,0.43668694,,
va,1.01712904,,
wa,0.40709699,,
wi,0.63547307,,