You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DDOS-7931: create kwargs for protein/ligand metadata - #655
Extend Entities.create_protein with state, preparation, structure_hash,
and a mapped origin value; create_ligand accepts origin only. Return the
new columns on create responses and cover payload translation with tests.
Use client fixture and mock-server routes instead of SDK client stub
tests/test_entities.py:560
This custom SDK client stub conflicts with the repository's platform-testing guidance: platform-facing behavior should go through the client fixture and mock-server routes rather than mocking DeepOriginClient methods. Please move any request-shape assertion needed here into the mock server and exercise it through the existing fixture (the integration tests below already cover the returned metadata).
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Batch creation does not honor the new origin contract, and live-capable tests use mock-only protein IDs.
Review effort: Balanced Findings: None
Previously missed (3)
In code that hasn't changed since last review
Batch ligand creation does not map the origin field
src/platform/entities.py:571
batch_create_ligands documents each row as accepting the optional fields of create_ligand, but this new nested field is only translated on the singular path. The batch path passes each row through _writable_ligand_set_fields, so {"origin": ...} is sent as a raw origin column instead of the required origin_* columns. Map origin for every batch row using the same payload builder, or explicitly narrow the batch API contract so callers are not directed to send an unsupported field.
Test uses invalid hard-coded protein ID in dev
tests/test_entities.py:652
This lv1 test can also run with --env dev, where the mock-only ID "brd" is not the protein uploaded above. The test therefore records invalid provenance (or fails if the platform validates the reference) outside local mode. Resolve or create the source protein from _BRD_PDB_REMOTE and pass its returned ID instead, as the notebook example does.
Integration test hard-codes a nonexistent protein ID
tests/test_entities.py:676
This integration test also hard-codes the local mock protein ID even though the client fixture supports live environments. Uploading _BRD_PDB_REMOTE does not create a protein row, so on dev the ligand's origin is nonexistent or rejected. Create/search the source protein first and use the actual returned ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
state,preparation,structure_hash, and mappedorigintoEntities.create_proteinorigintoEntities.create_ligand(platform-aligned: ligands do not accept protein prep fields)origin(kind,entity_type,entity_id) toorigin_*platform columns; omit server-managedorigin_entity_display_idon writereturningfield listsMerge-ready status
Auto-updated — cycle 3, last updated: 2026-10-06T00:38:18Z
main9bc59a0b7ca03eRecent activity
b7ca03ewith no new comments.merge-readylabel confirmed.Test plan
pytest tests/test_entities.py::test_create_protein_forwards_metadata_payload tests/test_entities.py::test_create_ligand_forwards_origin_payload tests/test_entities.py::test_create_protein_metadata_lv1 tests/test_entities.py::test_create_ligand_origin_lv1 --env localUnblocks toolbox registration work (e.g. DDOS-8071).
https://deeporigin.atlassian.net/browse/DDOS-7931