Skip to content

Resolve output references used as dictionary keys - #894

Open
CAOShurong wants to merge 1 commit into
materialsproject:mainfrom
CAOShurong:codex/838-resolve-reference-keys
Open

CAOShurong wants to merge 1 commit into
materialsproject:mainfrom
CAOShurong:codex/838-resolve-reference-keys

Conversation

@CAOShurong

Copy link
Copy Markdown

Summary

  • resolve OutputReference objects used as dictionary keys as well as values
  • preserve nested key references through Monty serialization, including inside MSONable objects
  • reject unhashable resolved keys and duplicate resolved keys instead of silently losing data
  • add unit and run_locally regression coverage for BUG: Dictionaries with output references as keys do not resolve #838

Fixes #838.

Additional dependencies introduced (if any)

None.

TODO (if any)

None.

Checklist

  • Code follows the repository style (pre-commit passes).
  • Private helper docstrings and type annotations are included.
  • Tests cover the new behavior and failure boundaries.
  • Focused tests, the full suite, package builds, and a clean-wheel workflow were run.

Verification

  • pytest tests/core/test_reference.py tests/managers/test_local.py::test_output_reference_as_dictionary_key -q: 18 passed
  • pytest -q: 140 passed, 8 skipped, 1 xfailed on a successful full run. A repeat encountered three Windows same-timestamp assertions in unrelated local-manager tests; two of the representative failures reproduced on the exact base commit.
  • pre-commit run --files src/jobflow/core/reference.py tests/core/test_reference.py tests/managers/test_local.py: passed
  • python -m build: sdist and wheel built successfully
  • clean install of the built wheel: the issue reproduction returned {'text': 'c', 'test': 'text'}

Disclosure: this pull request was prepared with assistance from OpenAI Codex; the implementation and verification evidence are provided here for maintainer review.

@utf

utf commented Oct 19, 2026

Copy link
Copy Markdown
Member

Hi @CAOShurong, thank you for this. Are you able to resolve the conflicts with the existing branch? Note, we have just merged #870 which may overlap here.

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.

BUG: Dictionaries with output references as keys do not resolve

2 participants