Skip to content

[SYNPY-1880] Add documentation for using in-session validation#1430

Open
thomasyu888 wants to merge 5 commits into
SYNPY-1880-cleanfrom
SYNPY-1880-doc
Open

[SYNPY-1880] Add documentation for using in-session validation#1430
thomasyu888 wants to merge 5 commits into
SYNPY-1880-cleanfrom
SYNPY-1880-doc

Conversation

@thomasyu888

@thomasyu888 thomasyu888 commented Jul 22, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread docs/guides/extensions/curator/metadata_contribution.md Outdated
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}")
Comment thread docs/guides/extensions/curator/metadata_contribution.md
Comment thread docs/guides/extensions/curator/metadata_contribution.md
Comment thread docs/guides/extensions/curator/metadata_contribution.md Outdated
Comment thread docs/guides/extensions/curator/metadata_contribution.md
Comment thread docs/guides/extensions/curator/metadata_contribution.md
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:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear to me if we need this section and if it just adds to the confusion

thomasyu888 and others added 3 commits July 22, 2026 09:20
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>
@thomasyu888
thomasyu888 requested a review from cconrad8 July 22, 2026 16:22
query_request = QueryRequest(query=GridQuery(column_selection=[SelectAll()]))
query_result = grid.validate_rows(query_request=query_request)

if query_result.rows is None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if query_result.rows is None:
if not query_result.rows:

This will also check for a 0-length number of rows.

@BryanFauble BryanFauble left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@linglp linglp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

4 participants