Skip to content
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

Match date formats to concept model #218

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Match date formats to concept model #218

merged 5 commits into from
Jul 13, 2023

Conversation

zmbc
Copy link
Collaborator

@zmbc zmbc commented Jul 8, 2023

Match date formats to concept model

Description

  • Category: bugfix
  • JIRA issue: none, but kind of a continuation of MIC-3962

As documented in the concept model, the date formats should be:

  • MMDDYYYY (no slashes) in WIC
  • YYYYMMDD in SSA
  • MM/DD/YYYY in all other datasets

This PR brings pseudopeople into alignment with this. Previously, WIC incorrectly used the default, and SSA incorrectly used the default in the date of birth column.

This turned out to be a much more involved change than I realized: previously, date format was incorrectly modeled as an attribute of the column when it is really an attribute of the dataset. Please let me know if I've done this wrong.

Testing

Ran all tests, including with --runslow. Manually stepped through the swap month and day noise function to ensure it was handling the new date format correctly.

@zmbc zmbc added the bug Something isn't working label Jul 8, 2023
for date_column in [COLUMNS.dob.name, COLUMNS.ssa_event_date.name]:
# Format both the actual column, and the shadow version that will be used
# to copy from a household member
for column in [date_column, COPY_HOUSEHOLD_MEMBER_COLS.get(date_column)]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes an unrelated bug I ran into: when a copy-within-household was performed, the column would become partially strings (original values) and partially true datetimes (copied values). This was silently failing in the swap month and day noise function.

Copy link
Member

@aflaxman aflaxman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this Zeb! It looks like you need to lint it to get it through the automatic tests, and it might be timing out, too, which is addressed in a recent PR by Steve to mark some tests as slow.

@zmbc zmbc merged commit 72680e1 into develop Jul 13, 2023
@zmbc zmbc deleted the bugfix/date-formatting branch July 13, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants