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

REST API: attributes_filter and extras_filter filters not working properly with pagination #3555

Closed
elsapassaro opened this issue Nov 18, 2019 · 0 comments · Fixed by #3556
Closed
Assignees
Milestone

Comments

@elsapassaro
Copy link
Contributor

In the REST API /nodes endpoint we have the extras_filter and attributes_filter filters. When attributes and extras are set to true in the query string and attributes_filter and/or extras_filter are specified, the query returns the nodes with the attributes and/or extras specified there. Attributes and extras are returned in the attributes and extras dictionaries, where the keys are the ones specified in attributes_filter and extras_filter.
This is not working correctly when pagination is requested, e.g. the request to the endpoint /nodes/page/1?attributes=true&attributes_filter=cell returns for each node dictionary an attributes.cell key instead of the expected attributes: {cell: ... } dictionary.

@elsapassaro elsapassaro self-assigned this Nov 18, 2019
elsapassaro added a commit to elsapassaro/aiida-core that referenced this issue Nov 18, 2019
Fixes aiidateam#3555.
The REST API attributes_filter and extras_filter were not working
correctly when pagination is requested.
Without pagination they return attributes and extras dictionaries
with the keys specified in attributes_filter and extras_filter
as expected.
When pagination is added they return instead the attributes keys
as attributes.key, which is not consistent with the expected
behavior.
@sphuber sphuber added this to the v1.0.1 milestone Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants