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

add support for last_updated field in crosswalk generation #4649

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jtmst
Copy link
Collaborator

@jtmst jtmst commented Nov 5, 2024

Adds support for the updated_after param that checks CAP data for a last_updated field. This will allow us to generate crosswalk files consisting of cases that have been updated after a given date. Dates should be in either format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS+00:00.

Changes:

  • Adds updated_after param to the generate_cap_crosswalk command
  • Adds logic for filtering based on the given date
  • Unit tests added

@jtmst jtmst requested a review from mlissner November 5, 2024 17:12
@jtmst jtmst marked this pull request as ready for review November 5, 2024 17:25
@jtmst jtmst marked this pull request as draft November 5, 2024 20:36
@jtmst jtmst marked this pull request as ready for review November 5, 2024 20:39
Copy link
Member

@quevon24 quevon24 left a comment

Choose a reason for hiding this comment

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

Everything is fine, I just left two small optional comments

)
except ValueError:
try:
self.updated_after = datetime.strptime(
Copy link
Member

Choose a reason for hiding this comment

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

maybe you can follow the same style and do this:

self.updated_after = options["updated_after"]

I think you can do this in one line, if something fails it will raise the ValueError exception:

self.updated_after = datetime.strptime(updated_after, "%Y-%m-%d").replace(tzinfo=pytz.UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants