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

How can I validate a CSV field with a combination of predefined values? #1704

Open
megin1989 opened this issue Nov 18, 2024 · 0 comments
Open

Comments

@megin1989
Copy link

Hi,

I'm working with Frictionless to validate a CSV file, and I need to validate a field (shod_domain) against a predefined set of values. The set of allowed values is:

sdoh-category-unspecified
food-insecurity
housing-instability
homelessness
inadequate-housing
transportation-insecurity

The problem is that the field in the CSV file sometimes contains a comma-separated combination of these values. For example:

Homelessness, Housing Instability
I want to validate each value in the field to make sure that it's part of the predefined set. If there are any invalid values, I need to report them.

How can I implement this validation using Frictionless? Specifically, I would like to create a custom validation that checks if each comma-separated value in the shod_domain field belongs to the allowed set.

Any help or example code would be greatly appreciated!

Thanks!

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

No branches or pull requests

1 participant