-
Notifications
You must be signed in to change notification settings - Fork 172
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
#4179: Dataset ComplexDataFacade returning wrong empty value #4180
#4179: Dataset ComplexDataFacade returning wrong empty value #4180
Conversation
@stefan-korn I'm not sure about this -- can you give an example case where |
@stefan-korn I did read it, I'd like to observe the behavior before and after the fix to properly review. Can you post an example schema that would let me reproduce the issue? |
@dafeder : I am attaching an example of dataset.json which can produce the issue. There is new property "dctconformsto" in the distribution (as an array of objects).
|
Hmmm @stefan-korn I have been trying to test... with your branch I get the same error on indexing, but now I also get a new error at the top of every form on the site:
Here is the dataset I tried indexing: {
"title": "Test dataset",
"description": "This is a test dataset",
"accessLevel": "public",
"modified": "2019-01-01",
"keyword": ["test", "dataset"],
"distribution": [
{
"title": "Test distribution",
"format": "text/csv",
"downloadURL": "https://example.com/test.csv",
"dctconformsto": [
{
"dct_standard": "https://www.w3.org/TR/vocab-dcat-2/"
}
]
}
]
} |
CodeClimate no longer shows what the issue was, and I rebased and pushed it as PR #4236 and it passed, so going to ignore that :). Re-testing. |
@stefan-korn OK I have tested this and I get the same error message on index, "Object of class stdClass could not be converted to string", whether I use your branch or not. But I don't think this has anything to do with empty values? This error seems to be more about how well it can handle nested objects within the dataset schema. Which is maybe just a different issue, this field handling should be more recursive so that it's possible to index fields more than 2 levels deep in the JSON tree. |
@stefan-korn the code in your PR does just look more inherently correct and is so small I am ok with merging it. I would have liked to be able to reproduce an actual problem here and see your PR resolving it, so if I am testing wrong let me know. I don't want to drag this out too much especially if this resolves an issue you're having. Again, I do think we've identified a second problem here which I may address myself as I'm on a new project that probably requires deeper levels of nesting in the schema than we've used before. |
@dafeder : Hmm, at this moment I can also not reproduce the original issue we had. I suppose by providing the dataset.json that produces an error, I was somehow let wrong. It's true that this error relates to deeper nesting and happens with or without. but the original issue was different. I was pretty sure about this change then, but now I am a bit baffled with this. So, it's up to you if you want to get this in, but I do not want to push you if you do not feel comfortable with this. .. I am currently not feeling comfortable with this whole issue ... |
Yes - I think if I understand the original issue correctly, just creating a dataset with no theme, and creating a theme filtering by theme IS NULL, should not show that dataset right? Because the index would not record "NULL" but whatever would be the equivalent of an empty array in a search index. But I tried this (on 2.x branch) and filtering by theme IS NULL actually produces the correct hit. So.. yes until we can actually demonstrate the effect of this bug in a reproducible way I think we should close this and create a new issue for the nesting problem. |
fixes #4179