-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handle datapackage.json that may cause 500 errors #355
Comments
16 tasks
@rufuspollock If it is ok to fix (hack) this on server side for now, let's do this in this milestone. |
@zelima - agree with working on this issue. Re the analysis:
|
zelima
added a commit
that referenced
this issue
May 10, 2017
zelima
added a commit
that referenced
this issue
May 10, 2017
- includes small helper function that validates descriptor - tested - logic updated and test included to check invalid licenses refs #355
FIXED see solution section in analyses |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes we have cases, when datasets pass the Data Package validation and are published, but still throwing 500 errors.
Tasks
Analysis
Reason for this is that even after validation there still may remain beyond Frictionless metadata specifications. Eg
licenses
property should be list of objects, not directly object etc and DP validation does not cover this kind of "mistakes" from users. Problem is that on server side we follow "rules" and always waiting that metadata (datapackage.json) will follow specifications.We faced issue exactly like this with Geo data packages - you can see deeper discussions here #335
The problem is that, we can not rely on user and assume he/she will always set licenses to be a list of the objects, bot not either "overload" and ask to learn all the specifications.
We have several options:
licenses
is not set according to specs. This way we are guaranteed that it will always be list of the objectsPersonally I think most reliable way to avoid this kind of error in the future is 3rd option (to modify validation script and worn users before publishing). But this is from perspective of developer.
We should consider that users do not want to sit and learn all the tiny details. They wan't to publish their data and that should be as simple as possible
Solution
As right now the 500 error might caused only in because Jinja template is expecting zeroth element from object Eg:
I propose to have a helper function in logic layer
validate_for_template(descriptor)
that will check type of licenses and just pop licenses from descriptor if not validThe text was updated successfully, but these errors were encountered: