Skip to content

Parse and validate two-digit dates#245

Merged
bamader merged 6 commits into
mainfrom
two-digit-dates
Mar 19, 2025
Merged

Parse and validate two-digit dates#245
bamader merged 6 commits into
mainfrom
two-digit-dates

Conversation

@bamader

@bamader bamader commented Mar 10, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR does two things:

  1. Adds more robust-handling of two-digit date strings, so that dates like 02/09/39 parse as 1939 rather than 2039,
  2. Adds validation that sets boundaries around acceptable dates by not accepting dates before 1850 and after the current day.

Related Issues

#237

Additional Notes

N/A
<--------------------- REMOVE THE LINES BELOW BEFORE MERGING --------------------->

Checklist

Please review and complete the following checklist before submitting your pull request:

  • I have ensured that the pull request is of a manageable size, allowing it to be reviewed within a single session.
  • I have reviewed my changes to ensure they are clear, concise, and well-documented.
  • I have updated the documentation, if applicable.
  • I have added or updated test cases to cover my changes, if applicable.
  • I have minimized the number of reviewers to include only those essential for the review.

Checklist for Reviewers

Please review and complete the following checklist during the review process:

  • The code follows best practices and conventions.
  • The changes implement the desired functionality or fix the reported issue.
  • The tests cover the new changes and pass successfully.
  • Any potential edge cases or error scenarios have been considered.

@codecov

codecov Bot commented Mar 10, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.82%. Comparing base (a2798c1) to head (ca1aff1).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
+ Coverage   97.72%   97.82%   +0.09%     
==========================================
  Files          32       33       +1     
  Lines        1674     1744      +70     
==========================================
+ Hits         1636     1706      +70     
  Misses         38       38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/unit/assets/patient_bundle_to_link_with_mpi.json
Comment thread tests/unit/schemas/test_pii.py Outdated
Comment thread src/recordlinker/schemas/pii.py Outdated
Comment thread src/recordlinker/schemas/pii.py Outdated
Comment thread src/recordlinker/schemas/pii.py
@bamader bamader requested a review from ericbuckley March 19, 2025 19:00

@ericbuckley ericbuckley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @bamader

@bamader bamader merged commit 30132c8 into main Mar 19, 2025
@bamader bamader deleted the two-digit-dates branch March 19, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants