-
Notifications
You must be signed in to change notification settings - Fork 204
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
Validate dataset before create or update #312
base: master
Are you sure you want to change the base?
Validate dataset before create or update #312
Conversation
…tself if there is validation error during package_create
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this approach. Could you maybe create a test for this new option?
except (AttributeError, IndexError): | ||
package_type = 'dataset' | ||
# in case a 'dataset' plugin was registered w/o fallback | ||
package_plugin = lib_plugins.lookup_package_plugin(package_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that line be one level higher? Otherwise package_plugin
is not set if there was no exception on line 540.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package_plugin is set on line 537 and most of that code is actually copy paste from here https://github.com/ckan/ckan/blob/master/ckan/logic/action/create.py#L136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah perfect, thanks for the explanation!
I'll commit some tests and check that comment once I've cured of this flu of mine, so probably in couple of days or so. |
Is it something that can be rebased/reworked? |
Attempt number 2 to fix #151.
Dataset is now validated before it is given to the baseharvester, if there is validation error it is raised again to store it to the harvester log.