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

Validate dataset before create or update #312

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Zharktas
Copy link
Member

@Zharktas Zharktas commented Feb 8, 2018

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.

@metaodi metaodi self-requested a review February 13, 2018 15:47
Copy link
Member

@metaodi metaodi left a 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)
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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!

@Zharktas
Copy link
Member Author

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.

@frafra
Copy link
Contributor

frafra commented Mar 4, 2022

Is it something that can be rebased/reworked?

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.

DetachedInstanceError when harvesting CKAN
3 participants