Skip to content

mapMetadata: check if lookup and domain file are incompatible#128

Merged
RayStick merged 4 commits into
mainfrom
check_lookup_bug
Oct 18, 2024
Merged

mapMetadata: check if lookup and domain file are incompatible#128
RayStick merged 4 commits into
mainfrom
check_lookup_bug

Conversation

@RayStick
Copy link
Copy Markdown
Contributor

@RayStick RayStick commented Oct 18, 2024

Closes #127

Proposed Changes

  • Added a check in mapMetadata to see if a user-specified lookup file is incompatabile with the domain codes (which can be viewed in the plots tab)
  • When putting this PR together, I realized the PR template needed updating

To test the code

No Error (using default lookup)

mapMetadata(json_file = 'inst/inputs/national_community_child_health_database_(ncchd)_20240405T130125.json', domain_file = 'inst/inputs/domain_list_demo.csv', look_up_file = 'inst/inputs/look_up.csv')

Error (using intentionally wrong lookup)

inst/inputs/look_up_WRONG.csv is the same as inst/inputs/look_up.csv but with these added lines at the bottom:

TEST,TEST,8
TEST,TEST,-1
TEST,TEST,11

mapMetadata(json_file = 'inst/inputs/national_community_child_health_database_(ncchd)_20240405T130125.json', domain_file = 'inst/inputs/domain_list_demo.csv', look_up_file = 'inst/inputs/look_up_WRONG.csv')

returns:

ℹ Using look up file inputted by user

 ✖ The look_up_file and domain_file are not compatabile. These look up codes are not listed in the domain codes:

[1]  8 -1 11
Error in mapMetadata(json_file = "inst/inputs/national_community_child_health_database_(ncchd)_20240405T130125.json",  : 

Checklist before review:

  • Please comment on my PR while it's a draft and give me feedback on the development!
  • I added everything I wanted to add to this PR, please review!
  • The title of this PR is clear and self-explantory.
  • I added any appropriate labels to this PR.
  • devchecks still pass

@RayStick RayStick changed the title check if lookup and domain fil are incompatible Check if lookup and domain file are incompatible Oct 18, 2024
@RayStick RayStick changed the title Check if lookup and domain file are incompatible mapMetadata: check if lookup and domain file are incompatible Oct 18, 2024
@RayStick RayStick added this to the before rOpenSci milestone Oct 18, 2024
@RayStick RayStick marked this pull request as ready for review October 18, 2024 08:30
@github-actions github-actions Bot added the internal Changes related to GH workflows, actions, apps label Oct 18, 2024
@Rainiefantasy
Copy link
Copy Markdown
Collaborator

Yay it works! 😸
Well done for doing the fix so quickly!
Screenshot 2024-10-18 at 10 43 50

Copy link
Copy Markdown
Collaborator

@Rainiefantasy Rainiefantasy left a comment

Choose a reason for hiding this comment

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

Approved ✅

@RayStick RayStick merged commit 2b45600 into main Oct 18, 2024
@RayStick RayStick deleted the check_lookup_bug branch October 18, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix internal Changes related to GH workflows, actions, apps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functionality to ensure lookup file domain codes match those in the domain list

2 participants