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

Conditional warning #28

Open
afranke opened this issue Jun 5, 2019 · 1 comment
Open

Conditional warning #28

afranke opened this issue Jun 5, 2019 · 1 comment
Milestone

Comments

@afranke
Copy link
Contributor

afranke commented Jun 5, 2019

The spec allows a validation rule to trigger a warning instead of an error, but it doesn’t allow for a given field to trigger an warning if a condition is met and an error in other cases.

To give a more concrete example of what I’m trying to achieve, a field I’m validating is an IMDb id for movies. They used to be strictly tt+ 7 digits, so anything else was invalid, but they recently introduced tt + 8 digits too. The latter is valid so it should not be an error, but it is fairly uncommon and may be suspicious (we had several cases of accidental extraneous characters in that field). I’d like to have an error for anything that is not tt + 7 or 8 digits, and warnings for tt + 8 digits.

@DavidUnderdown DavidUnderdown added this to the 1.2 milestone Jun 10, 2019
@DavidUnderdown
Copy link
Contributor

Thanks

I think this would be a fairly big change due to the way the warning mechanism is currently implemented (though I can see its utility), directives apply at the level of the whole test for a field, rather than individual parts of it. We've been rather short of developers so haven't been able to do much on the schema/validator recently so there is no definite date for a new revision of the schema language to be released I'm afraid, though I'll pencil this in for review under 1.2. If there's any chance you could come up with a formal proposal as a pull request to the CSV Schema Language, that would be helpful.

David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants