Skip to content

Commit efcd0ba

Browse files
Jingjing TangJingjing Tang
authored andcommitted
add an assert statement to make sure that the prefix for den and num are the same
1 parent d1bbd99 commit efcd0ba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

changehc/delphi_changehc/load_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def load_combined_data(denom_filepath, covid_filepath, base_geo,
9393

9494
# Get issue_date from the filename
9595
issue_date = datetime.strptime(covid_filepath.split("/")[-1][:8], "%Y%m%d")
96+
assert (
97+
issue_date == datetime.strptime(denom_filepath.split("/")[-1][:8], "%Y%m%d")
98+
), "The aggregated files used for Covid Claims and Total Claims should have the same drop date."
99+
96100

97101
# load each data stream
98102
denom_data = load_chng_data(denom_filepath, issue_date, base_geo,
@@ -137,6 +141,10 @@ def load_cli_data(denom_filepath, flu_filepath, mixed_filepath, flu_like_filepat
137141

138142
# Get issue_date from the filename
139143
issue_date = datetime.strptime(flu_filepath.split("/")[-1][:8], "%Y%m%d")
144+
assert (
145+
issue_date == datetime.strptime(denom_filepath.split("/")[-1][:8], "%Y%m%d")
146+
), "The aggregated files used for CLI Claims and Total Claims should have the same drop date."
147+
140148

141149
# load each data stream
142150
denom_data = load_chng_data(denom_filepath, issue_date, base_geo,
@@ -188,6 +196,10 @@ def load_flu_data(denom_filepath, flu_filepath, base_geo,
188196

189197
# Get issue_date from the filename
190198
issue_date = datetime.strptime(flu_filepath.split("/")[-1][:8], "%Y%m%d")
199+
assert (
200+
issue_date == datetime.strptime(denom_filepath.split("/")[-1][:8], "%Y%m%d")
201+
), "The aggregated files used for Flu Claims and Total Claims should have the same drop date."
202+
191203

192204
# load each data stream
193205
denom_data = load_chng_data(denom_filepath, issue_date, base_geo,

0 commit comments

Comments
 (0)