Skip to content

[SYNPY-1913] Added missing grid field - #1465

Merged
andrewelamb merged 3 commits into
developfrom
SYNPY-1913
Oct 1, 2026
Merged

andrewelamb merged 3 commits into
developfrom
SYNPY-1913

Conversation

@andrewelamb

@andrewelamb andrewelamb commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem:

  • SYNPY-1913: the Grid and GridSession models do not capture all fields in the current GridSession REST schema.
  • Reproduced by calling get_or_create_curator_grid(task_id=...). The raw GET grid session response includes sourceEntityVersionNumber (e.g. 13), but the returned Grid object has no source_entity_version_number attribute. The source_entity_id field from the same response is captured correctly.
  • Affected code: synapseclient/models/curation.py (GridSession, Grid, CreateGridRequest).

Solution:

  • Added the source_entity_version_number: Optional[int] field and its docstring to GridSession and Grid.
  • GridSession.fill_from_dict and Grid.fill_from_dict now read sourceEntityVersionNumber.
  • CreateGridRequest.fill_grid_session_from_response now reads sourceEntityVersionNumber.
  • Grid.create_async (attach-to-previous-session path) now copies source_entity_version_number from the existing session.
  • Out of scope: the attach-to-previous-session path in Grid.create_async also does not copy owner_principal_id or authorization_mode. This is a separate defect. The raw GET response does not include authorizationMode, so copying it could set it to None and remove the caller's value. We must find out what the server returns before we fix this in a separate ticket.

Testing:

  • Unit tests (tests/unit/synapseclient/models/async/unit_test_curation_async.py):
    • Added sourceEntityVersionNumber to the shared _get_grid_session_response() fixture.
    • Added source_entity_version_number asserts to TestGrid.test_fill_from_dict, test_create_async_with_record_set_id, test_create_async_attach_to_previous_session, test_list_async, and TestCreateGridRequest.test_fill_grid_session_from_response.
    • All 213 tests in the module pass.
  • Integration tests (tests/integration/synapseclient/models/async/test_grid_async.py):
    • Added a source_entity_version_number assert next to each source_entity_id assert.
    • Tests pass. They confirm that the server returns the RecordSet version for a RecordSet source, and None for an EntityView source.

🤖 Generated with Claude Code

@andrewelamb
andrewelamb requested a review from a team as a code owner October 1, 2026 17:40
@andrewelamb
andrewelamb marked this pull request as draft October 1, 2026 17:40
@andrewelamb andrewelamb changed the title added missing grid field [SYNPY-1913] Added missing grid field Oct 1, 2026
@andrewelamb
andrewelamb marked this pull request as ready for review October 1, 2026 17:42
@andrewelamb
andrewelamb merged commit 4907616 into develop Oct 1, 2026
20 checks passed
@andrewelamb
andrewelamb deleted the SYNPY-1913 branch October 1, 2026 20:24
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.

2 participants