-
Notifications
You must be signed in to change notification settings - Fork 25
Add ERROR to the includeDatasetResponses enum #254
Comments
@jrambla I support the idea but because 1.1.1 milestone is already past due by 7 days, should we add this to 1.1.2? |
In what case would a dataset return an error? Currently in Beacon we have errors in response for the service. |
You're right, but maybe this could be improved. I mean, one of the errors that could happen is that the user sends an |
Example of the response when there are 2 datasets and one of them has detected an error: [
{
"beaconId": "some-beacon",
"apiVersion": "v1.0.1",
"exists": true,
"alleleRequest": {
"referenceName": "1",
"start": 1111,
"end": null,
"startMin": null,
"startMax": null,
"endMin": null,
"endMax": null,
"referenceBases": "A",
"alternateBases": "C",
"variantType": null,
"assemblyId": "GRCh38",
"datasetIds": [
"1","2"
],
"includeDatasetResponses": "ALL"
},
"datasetAlleleResponses": [
{
"datasetId": "1",
"exists": true,
"error": null,
"frequency": 0.002222,
"variantCount": 1,
"callCount": 4,
"sampleCount": 1,
"note": null,
"externalUrl": null,
"info": null
},
{
"datasetId": "2",
"exists": null,
"error": {
"errorCode": "400",
"errorMessage": "User provided assemblyId (GRCh38) does not match with dataset assembly (GRCh37)"
},
"frequency": null,
"variantCount": null,
"callCount": null,
"sampleCount": null,
"note": null,
"externalUrl": null,
"info": null
}
],
"error": null
}
] |
I can see your point, but if the user is looking for
|
mmm I don't agree :P If the user knows the assemblies do not match, they can choose to convert the |
Trying to see if I understood it correctly in order to properly implement it:
Questions:
|
I think that if you request a dataset which does not exist, you should fill the top level [
{
"beaconId": "some-beacon",
"apiVersion": "v1.0.1",
"exists": null,
"alleleRequest": {
"referenceName": "1",
"start": 1111,
"end": null,
"startMin": null,
"startMax": null,
"endMin": null,
"endMax": null,
"referenceBases": "A",
"alternateBases": "C",
"variantType": null,
"assemblyId": "GRCh38",
"datasetIds": [
"1","2","invented_dataset_001"
],
"includeDatasetResponses": "ALL"
},
"datasetAlleleResponses": null,
"error": {
"errorCode": "404",
"errorMessage": "Dataset invented_dataset_001 does not exist"
}
}
] And if the parameters are valid but there is an incompatibility among them (in my example, between the assembly of one of the datasets and the requested assembly) then you should fill the Also, I think you're right and if the assemblyId does not exist in this Beacon, you should answer with a 404 error. |
I see, then if the responses you illustrated above are to implemented, maybe some suggestions to consider:
|
Regarding the 1st bullet point: Regarding the 2nd bullet point: |
The principals about error returning in Beacon are as follows:
Thanks to recent conversations about the errors, I've realized that "BeaconError" is still the original one, and it is not well suited for the more granular response (i.e. BeaconDatasetAlleleResponse). Thus we need to "upgrade" it. Let's do it in another issue, however. Hope this clarifies. |
@sdelatorrep you are right, I should have explained 1st bullet point better:
How I interpret that considering the example above is that if there is an error in one of the datasets from An simple way to eliminate this confusion would be to remove the required 2nd bullet point: unfortunately business travel this week, but maybe there are other time slots for such a discussion. |
@jrambla I am sorry this is a bit confusing to me and how any services making use of the Beacon API should process these:
Confusing because the Beacon specification does not specify a ... and if something creates confusion maybe it should not be in any specification ;) - as I mentioned above, maybe it is is easier not to reflect an HTTP code in that required |
In my understanding the text you refer (and that I always forget as I look directly into the OpenAPI spec) is misleading and probably should be considered obsolete. I've created another issue (#262) to do all this changes and clarifications. In the current Beacon spec of the art, my example above must be; HTTP return code: 200 (in the HTTP response header) Hope this clarifies. |
Sorry for the long message, but I wanted to detail my point of view. @jrambla But maybe I missed something so I went over these past issues/decisions (I have not seen others):
In issue #170 it is mentioned:
and I like the proposed solution, without the error codes:
One of the use cases I could think of is having an aggregator for faulty/erroneous beacons, but in issue #207 it seems that Actually I like the way it was designed in In Probably it would be a better solution, in the long term, to use custom codes for dataset specific errors - meaning
snippet for {
"datasetAlleleResponses": [{
"error": {
"errorCode": "DATASET_NOT_FOUND",
"errorMessage": "Requested dataset `<requested_dataset>`, was not found in this beacon."
}
}]
} for EDIT: meant to write @sdelatorrep I did not consider bringing this up, as this was not part of these issues, but with the PR you made #267 I would like to point out that the examples you provided are not consistent with the OpenAPI type definitions.
Now if we use the examples you provided as an input JSON:
or
you would see how those are not valid input, to better understand the why see issue: |
I totally missed this last comment. And I'm also confused, probably because we're having the very same discussion in different issues and PRs. I think we should continue in #267 (only!). |
Currently, if a dataset if returning an error it is only included in the ALL option.
A user would probably expect that ALL is equal to HIT+MISS, but it is actually ALL=HIT+MISS+ERROR.
I suggest to add such filtering option to improve comprehensiveness and clarity.
The text was updated successfully, but these errors were encountered: