Skip to content

Keep served entries' fields when their thermo doc is missing - #1153

Open
kavanase wants to merge 1 commit into
materialsproject:mainfrom
kavanase:fix/keep-material-id-missing-thermo-docs
Open

kavanase wants to merge 1 commit into
materialsproject:mainfrom
kavanase:fix/keep-material-id-missing-thermo-docs

Conversation

@kavanase

@kavanase kavanase commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Minor fix, following #1144. Served entries without a thermo doc got dict.fromkeys(property_data), so any requested field that already had (material_id, last_updated) was overwritten with None. Those values are now kept. The #1144 test now also requests material_id, which fails without this change.

This is a fix for the edge case where users who pass an older db_version (specifically db_version="2026.04.13") and also request material_id or last_updated (otherwise served entries should always have a matching thermo doc). For db_version="2026.04.13" (the only case where this hits), 11 materials across 3,643 of the 117,162 served mixed phase diagrams have no matching thermo doc. The latest db_version avoids this issue.

Checklist

  • [~] Google format doc strings added. Check with ruff.
  • [~] Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • [~] If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

@kavanase

Copy link
Copy Markdown
Contributor Author

Noting that the CI failure is unrelated to this PR.

This branch has not been deployed

No deployments
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.

1 participant