Skip to content

fix: exclude requested fields from fields_not_requested#1066

Merged
esoteric-ephemera merged 3 commits into
materialsproject:mainfrom
akshikari:fix/unavailable-fields
Mar 4, 2026
Merged

fix: exclude requested fields from fields_not_requested#1066
esoteric-ephemera merged 3 commits into
materialsproject:mainfrom
akshikari:fix/unavailable-fields

Conversation

@akshikari

@akshikari akshikari commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This is my first contribution so hope this is helpful.

This is a fix for the bug mentioned in #940. Before, fields_not_requested incorrectly included fields that were explicitly requested but absent from the DB response. Required piping the requested fields down a few levels in an additional requested_fields parameter for the _convert_to_model and _generate_returned_model methods. S3 path is unchanged since requested_fields is optional. Addresses the TODO in commit 87c072e.

@akshikari
akshikari marked this pull request as ready for review March 4, 2026 17:09
@esoteric-ephemera

Copy link
Copy Markdown
Collaborator

Thanks @akshikari - there's a bit more nuance here with fields that exist in the document model but aren't set in the database. Have added that split + some other tests, will merge once they pass

@esoteric-ephemera
esoteric-ephemera merged commit 2d0ffff into materialsproject:main Mar 4, 2026
1 of 3 checks passed
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.

[Bug]: requesting all fields yields to fields with fields_not_requested, even when manually inputting them

2 participants