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

checking for ambiguous csv formats #40

Merged
merged 2 commits into from
Jun 12, 2024
Merged

checking for ambiguous csv formats #40

merged 2 commits into from
Jun 12, 2024

Conversation

shaselton-usds
Copy link
Collaborator

One line description of your change (less than 72 characters)

CSV format can be built in a way that the validator is unable to determine if it is a Wide or Tall format.

Problem

When the validator encounters a CSV format that is without Tall specific column headers: payer_name and plan_name as well as lacking any payer/plan combinations that are found in the Wide format, the validator's default behavior was to try to validate the CSV against the Wide format ruleset.

Solution

The validator now checks for both types of formats before doing any additional validation.

Result

The validator will now catch CSV files that do not have either a Tall or Wide format, throw an error, and inform the user to update their file to conform to either the Tall or Wide format.

Test Plan

Unit tests added to check functionality.

Copy link
Collaborator

@mint-thompson mint-thompson left a comment

Choose a reason for hiding this comment

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

This looks like it perfectly handles the "not enough columns to tell" ambiguous case. Do we also want to add handling for the "too many columns" ambiguous case, where we have the payer_name and plan_name columns, and also at least one set of payer-plan columns?

Copy link
Collaborator

@eoverly eoverly left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@shaselton-usds
Copy link
Collaborator Author

@mint-thompson updated to check for both wide and tall formats: ee9aa8f

@mint-thompson
Copy link
Collaborator

@mint-thompson updated to check for both wide and tall formats: ee9aa8f

Looks good, thank you!

@shaselton-usds shaselton-usds merged commit 181f221 into main Jun 12, 2024
4 checks passed
@shaselton-usds shaselton-usds deleted the ambiguous-format branch June 12, 2024 06:38
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.

3 participants