-
Notifications
You must be signed in to change notification settings - Fork 49
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
Resolve TODO #676
Comments
Hi @c0c0n3
I am saying that it is thrown by connection framework because of this line. |
Gentle reminder! |
Hi @NEC-Vishal, sorry for the delay, I'm slowly working through the list of GH notifications :-)
I think whoever wrote that TODO mean "invalid", i.e. the entity didn;t pass all the validation checks in
that's correct, but Now onto the TODO. I think the intention of that TODO was to remind us that at the moment if even just a single entity in the payload doesn't pass validation, we throw away the whole payload. A better option would be to split the payload into two lots, valid and invalid entities, insert the valid entities and return a partial failure error with the IDs of the entities that couldn't be inserted. |
@c0c0n3 yes we can split the payload into 2 parts, but main problem is how can we find the error, because before coming into notify() it will through error. |
@NEC-Vishal I think this TODO is not relevant anymore. I'm just looking at the code as it stands now def notify():
# ...
for entity in payload:
# Validate entity update
error = _validate_payload(entity)
if error:
# TODO in this way we return error for even if only one entity
# is wrong
return error, 400
# ... and I think that
Surely, I could've missed something. But maybe you could write a test to check whether I'm right or wrong, then we'll take it from there? |
Resolve Todo:
ngsi-timeseries-api/src/reporter/reporter.py
Line 166 in 6ecedfe
The text was updated successfully, but these errors were encountered: