[SYNPY-1880] Add documentation for using in-session validation#1430
Open
thomasyu888 wants to merge 5 commits into
Open
[SYNPY-1880] Add documentation for using in-session validation#1430thomasyu888 wants to merge 5 commits into
thomasyu888 wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Curator “Metadata contribution” guide to document how contributors can run JSON-schema validation directly in a Grid session (“in-session validation”) before exporting/synchronizing, helping users catch issues earlier in the curation workflow.
Changes:
- Added a new “Validate your edits in-session” step with
connect()+validate_rows()examples and guidance. - Renumbered subsequent steps and updated cross-references to match the new workflow ordering.
- Extended file-based curation guidance to highlight that in-session validation is the primary contributor-side validation mechanism (since there’s no RecordSet export report).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+163
to
+169
| query_result = grid.validate_rows(query_request=query_request) | ||
|
|
||
| if query_result.rows is None: | ||
| print("No rows matched the query.") | ||
| else: | ||
| for row in query_result.rows: | ||
| print(f"Row ID: {row.row_id}, Validation Result: {row.validation_results}") |
thomasyu888
commented
Jul 22, 2026
Comment on lines
+172
to
+178
| If you're landing here with only a `record_set_id` (no session yet), `connect()` will create — or, with `attach_to_previous_session=True`, reattach to — a session for you: | ||
|
|
||
| ```python | ||
| from synapseclient.models import Grid | ||
| from synapseclient.models.curation import GridQuery, QueryRequest, SelectAll | ||
|
|
||
| with Grid(record_set_id="syn123456789").connect() as grid: |
Member
Author
There was a problem hiding this comment.
Unclear to me if we need this section and if it just adds to the confusion
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
BryanFauble
reviewed
Jul 22, 2026
| query_request = QueryRequest(query=GridQuery(column_selection=[SelectAll()])) | ||
| query_result = grid.validate_rows(query_request=query_request) | ||
|
|
||
| if query_result.rows is None: |
Member
There was a problem hiding this comment.
Suggested change
| if query_result.rows is None: | |
| if not query_result.rows: |
This will also check for a 0-length number of rows.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem:
There needs to be documentation for users to understand how to use the in-session validation feature
Solution:
Added documentation - there is more nuance to how particular column validation can be returned and we aren't including that in this iteration of documentation.
Testing:
I ran through the commands to test this code.