Skip to content
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

NodeTranslator: do not assume get_export_formats exists #4188

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jun 19, 2020

Fixes #4185

The get_all_download_formats will try to call get_export_formats on
all the known plugin types. However, it is not guaranteed that all
plugins implement this method. This was properly considered in the case
that full_type is not None, however, in the other case the
AttributeError was not being caught causing the REST API to except.

The `get_all_download_formats` will try to call `get_export_formats` on
all the known plugin types. However, it is not guaranteed that all
plugins implement this method. This was properly considered in the case
that `full_type` is not None, however, in the other case the
`AttributeError` was not being caught causing the REST API to except.
@codecov
Copy link

codecov bot commented Jun 19, 2020

Codecov Report

Merging #4188 into develop will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4188      +/-   ##
===========================================
+ Coverage    78.93%   78.94%   +0.01%     
===========================================
  Files          467      467              
  Lines        34505    34501       -4     
===========================================
  Hits         27232    27232              
+ Misses        7273     7269       -4     
Flag Coverage Δ
#django 70.86% <100.00%> (+0.01%) ⬆️
#sqlalchemy 71.74% <100.00%> (+0.01%) ⬆️
Impacted Files Coverage Δ
aiida/restapi/translator/nodes/node.py 84.40% <100.00%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a57c03...4929135. Read the comment docs.

@sphuber sphuber merged commit 112f4b8 into aiidateam:develop Jun 19, 2020
@sphuber sphuber deleted the fix/4185/node-translator-get-all-download-formats branch June 19, 2020 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API crashes on classes that do not support certain methods
2 participants