-
Notifications
You must be signed in to change notification settings - Fork 12
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
Has api_update_gloss changed? #1360
Comments
It hasn't been changed. It's still the same. (There are some other issues about the database getting locked.) You want the empty value to erase the value? |
Ok, using "-" works! Thank you very much. About gloss HUREN-C; TransactionManagementError at /dictionary/api_update_gloss/5/49249/ This is what i have sent: {"Handedness": "N/A", "Strong Hand": "-", "Weak Hand": "B", "Handshape Change": "-", "Relation Between Articulators": "-", "Location": "-", "Contact Type": "-", "Movement Shape": "-", "Movement Direction": "-", "Repeated Movement": "", "Alternating Movement": "", "Relative Orientation: Movement": "-", "Relative Orientation: Location": "-", "Orientation Change": "-", "Virtual Object": "-", "Phonology Other": "-", "Mouth Gesture": "-", "Mouthing": "-", "Phonetic Variation": "-", "Senses": "{"en": [["hire"], ["rent, lease"]], "nl": [["huren"], ["huren"]]}"} |
Repeated Movement and Alternating Movement are supposed to be Booleans. from the code:
The atomic block error would be caused by other errors. It can't do a save because probably some other things are saved. (I'll have to try to simulate your error with extra print statements to see where it is blocking.) |
Phonology Other fields dont seem to be updated too. Modifing the values to the ones you mentioned didnt help, it is causing only by this gloss but it could happen at other glosses too. |
Does your error message mention a specific line of code? It's true that if it finds an error in the input fields, it will not do the update. (It's implemented as all or nothing, otherwise the transaction would be inconsistent.) Do you want Handedness to be N/A ? There is the Weak Hand set, so is that Handedness 1 or is it something else? |
These fields: "Virtual Object": "-", "Phonology Other": "-", "Mouth Gesture": "-", "Mouthing": "-", "Phonetic Variation": "-", are strings, so you can just put empty strings (the ones that are choices need to be "-") If you don't want to set any value, you can exclude them from the json dictionary. |
I looked up the gloss on Signbank. |
I can't find any errors related to the HUREN gloss. So the code thinks it's working correctly.
(That's all it reports, nothing about what specifically. I'll add that exception to the code in order to catch it explicitly.) In the logs, there is an error for ANTONI GAUDI
The only place in the code where it explicitly uses "ascii" is in the For the zip files, you don't need to put the gloss annotation in the zipped filename. It can be something else, like videos_archive.zip |
There is definitely something wrong with HUREN-C, as i am trying to send this: {"Handedness": "1", "Strong Hand": "-", "Weak Hand": "-", "Handshape Change": "-", "Relation Between Articulators": "-", "Location": "-", "Contact Type": "-", "Movement Shape": "-", "Movement Direction": "-", "Repeated Movement": "False", "Alternating Movement": "False", "Relative Orientation: Movement": "-", "Relative Orientation: Location": "-", "Orientation Change": "-", "Virtual Object": "-", "Phonology Other": "-", "Mouth Gesture": "-", "Mouthing": "-", "Phonetic Variation": "-", "Senses": "{"en": [["hire"], ["rent, lease"]], "nl": [["huren"], ["huren"]]}"} Interestingly, the update goes through when i send like this: {"Handedness": "1", "Strong Hand": "-", "Weak Hand": "-", "Handshape Change": "-", "Relation Between Articulators": "-", "Location": "-", "Contact Type": "-", "Movement Shape": "-", "Movement Direction": "-", "Repeated Movement": "False", "Alternating Movement": "False", "Relative Orientation: Movement": "-", "Relative Orientation: Location": "-", "Orientation Change": "-", "Virtual Object": "-", "Phonology Other": "-", "Mouth Gesture": "-", "Mouthing": "-", "Phonetic Variation": "-"} So that's JSON payload without Senses. Something is going wrong with Senses field? |
Okay, that helps us to know! |
@rem0g I found the problem. This has to do with the use of two different formats for representing the senses internally. The json package considers them language-related fields and they are described as "Senses: Dutch" I wrote a new function to test whether the senses field in the update differs from that in the database. You need to omit the quotes around the Senses right-hand side. It's already in json. (It's not a string.)
This has been deployed. |
#1360: Fixed check on whether senses are being updated by API.
It works again! Thank you |
@rem0g One more thing relevant to this issue: We clearly did not document this well ;) |
Senses update doesnt work anymore again: Payload:
AttributeError at /dictionary/api_update_gloss/5/47662/'dict' object has no attribute 'strip' |
The format is wrong that you show above. @rem0g can you please stop putting "empty" "not changed" things in the "update" request? The gloss you show has hundreds of entries in the revision history. https://signbank.cls.ru.nl/dictionary/gloss/47662/history That causes extreme payload and causes the database to get locked. Hundreds of comparisons are being made to check if things are changed and hundreds of objects are being created for all the revision histories. It is likely that something else is causing the problem or the operation is failing because the database is getting locked. Think "thrashing" (too many operations are competing for resources) Every API request is a transaction. So the more "empty" things you put that need to be processed the more computations need to be done inside that transaction. |
Can you please explain why is the format wrong? It's the format i got from the API documentation: With omitted strings as you mentioned before. About the empty requests, yes I will be soon working on that soon. :) |
I looks like you have return characters in it? The processing needs to parse it, so it should be without pretty printing. (It's a Python library that parses it.) Normally, "strip" is done to make sure there are no spaces in the input. Can you post your actual input value for the field? I will find out if there is a parsing error. |
I am noticing a lot of errors regarding this gloss:
While submitting request to update phonology I am getting error Database locked at HUREN-C.
WHen submitting empty phonology feature such as:
"Handshape Change": ""
The handshape change is still not modified to empty value.
The text was updated successfully, but these errors were encountered: