-
Notifications
You must be signed in to change notification settings - Fork 89
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
Invalid schema #132
Invalid schema #132
Conversation
Test addition for when the expression in pattern in constraints for any field is not in valid regular expression form.
Replacement of conditional statement to see if a regular expression was created with a RegexpError rescue to catch when creation failed and act accordingly.
Some explaining of existing functionality as well as my previous commits concerning regular expression structure validation.
Hey @bcouston - try running |
@pezholio I'm still getting a hang up, it keeps making the same request, any ideas? Validations seem to be empty. |
Yeah, it should keep polling that request until the validation is created. What does the console output of |
[Worker(host:Bens-MacBook-Air.local pid:45708)] Job Package#create_package (id=55a4cdb442656eb33c000003) FAILED (4 prior attempts) with RegexpError: premature end of char-class: /[/ So the RegexpError is causing it to hang, can I get the app to execute the code in the rescue block and carry on with normal operation? @pezholio |
Ah, looks like the Regexp error is happening in the app, rather than here. I think catching that with a begin ... rescue block should be fine |
Ah, no, the code here is fine. It seems that there's an error happening in the CSVlint app. I'll have a dig. |
I just had change the link for the csvlint gem in the Gemfile in csvlint to refer the branch I was working on (invalid-schema) |
Cool cool, is this good to go then? |
@pezholio at the moment, it raises an invalid regular expression error for every record of the field in the csv that doesn't match the invalid regex (so every one). It would be a a lot cleaner if it was raised once and other errors/warnings concerning regex were not displayed, as an invalid regex form in the schema probably takes priority. Thoughts? |
Yeah, I think it's only sufficient to show the error once |
@pezholio on it |
Invalid Regex error now shows only once per a field with a pattern constraint that contains invalid regular expression form in the schema. Also skips reporting unmatching RegEx form between CSV and schema in that column when the error is found.
DO NOT MERGE until reviewed further. |
Fixes previously failing tests.
Cool, this looks good now. We'll need to add support for this in the Csvlint app too, so I won't merge just yet, especially as we have a few more PRs open |
Replacement of conditional statement to see if a regular expression was
created with a RegexpError rescue to catch when creation failed and act
accordingly.