[SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage from required attributes#1401
Conversation
…m required attributes for Evaluation creation PUT request body. add test coverage. update documentation.
There was a problem hiding this comment.
Pull request overview
This pull request updates the Evaluation OOP model so that submission_instructions_message and submission_receipt_message are treated as truly optional when building the REST request body for create/update operations, aligning client-side validation with the Synapse REST API’s accepted payloads.
Changes:
- Removed
submission_instructions_messageandsubmission_receipt_messagefrom the set of attributes required byEvaluation.to_synapse_request(). - Updated
to_synapse_request()to omit submission message fields from the request body when they areNone. - Added/updated unit and integration tests to verify evaluations (and submissions against them) can be created/updated without these optional message fields.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
synapseclient/models/evaluation.py |
Makes submission message fields optional in request validation and omits them from request bodies when unset. |
tests/unit/synapseclient/models/unit_test_evaluation.py |
Updates required-field tests and adds a unit test asserting request bodies omit optional message keys when absent. |
tests/integration/synapseclient/models/async/test_evaluation_async.py |
Adds integration coverage for creating and updating evaluations without optional message fields. |
tests/integration/synapseclient/models/async/test_submission_async.py |
Adds integration coverage for creating/retrieving submissions against an evaluation created without optional message fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jaymedina
left a comment
There was a problem hiding this comment.
Note: This comment has been generated with AI assistance and reviewed by me ✍️
Reviewed evaluation.py, unit_test_evaluation.py, test_evaluation_async.py, and test_submission_async.py. The core logic change is correct — the two message fields are properly removed from the required list and are now conditionally included in the request body only when non-None. Docstrings and examples are updated consistently. Two minor findings left as inline comments.
linglp
left a comment
There was a problem hiding this comment.
@jaymedina Hi Jenny! It looks good overall. I found some issues in the tests and docstring that should probably be fixed before merging.
…valuationCreation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BryanFauble
left a comment
There was a problem hiding this comment.
A few items in the testing structure to take a look at, otherwise LGTM!
…one submission msgs
|
Thanks all for the reviews~ @linglp can I get your eyes on those last unresolved threads before your approval so I can merge? Thanks in advance! |
Problem:
The Evaluation OOP model's
store()method incorrectly requiredsubmission_instructions_messageandsubmission_receipt_messageto be set before creating or updating an evaluation. These are optional display messagesshown to submitters. The Synapse REST API accepts PUT requests without them.
Solution:
submission_instructions_messageandsubmission_receipt_messagefrom the required attributes validated into_synapse_request().Testing:
Tests are passing locally: