-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor cdc_covidnet to use geo utils #311
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
Conversation
Unrelated to this refactor but I noticed the EDIT: I lied, not unrelated |
@chinandrew |
Cool thanks for verifying, will remove. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me pending an answer on my question above.
from_code="state_name", | ||
new_code="state_id", | ||
dropna=False) | ||
# To preserve column order, reassign original column and drop new one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test that fails if this line is omitted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if hosp_df[APIConfig.STATE_COL] = hosp_df["state_id"].str.upper()
is omitted, tests fail because APIConfig.STATE_COL isn't the two letter abbreviation.
if hosp_df.drop("state_id", axis=1, inplace=True)
is omitted, tests fail because dimensions are wrong.
I also actually just realized column order for these fields doesn't matter since there's a hosp_df.set_index(["date", "geo_id"], inplace=True)
right after, so this is actually just to avoid name collisions since there isn't currently functionality to replace a column while keeping the name the same. I've updated the comment to reflect that.
For #306. Depends on #310 (which is currently the base in this PR for easier review).
Summary of changes: