Skip to content

fix: Add Team docstring examples, delete_invitation method, and complete mkdocs reference - #1457

Merged
linglp merged 6 commits into
developfrom
fix-team-docstring
Sep 25, 2026
Merged

linglp merged 6 commits into
developfrom
fix-team-docstring

Conversation

@linglp

@linglp linglp commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem:

discovered while working on: https://sagebionetworks.jira.com/browse/SYNR-1624

Several methods on Team lacked docstring examples in both models/team.py and models/protocols/team_protocol.py, unlike other models such as Evaluation. Separately, delete_membership_invitation in api/team_services.py existed at the API layer but was never exposed on the Team model, so it never appeared in the mkdocs reference. Auditing all Team methods against the docs also turned up get_async/get, which existed on the model but was missing from the members: lists in docs/reference/experimental/{sync,async}/team.md.

Solution:

  • Docstring examples: Added Example: blocks (mkdocstrings admonition format) to every Team async method and to the class docstring in team.py, plus matching sync examples on TeamSynchronousProtocol in team_protocol.py, following the pattern used in evaluation.py/evaluation_protocol.py.
  • New delete_invitation_async/delete_invitation: Added a staticmethod on Team (and matching protocol signature) that wraps the existing delete_membership_invitation API function, so an open invitation can be cancelled via Team.delete_invitation_async(invitation_id=...).
  • Docs completeness: Added delete_invitation(_async) and the previously-missing get(_async) to the members: lists in both team.md reference pages so every public Team method now renders in the API reference.
  • Minor docstring fix: get_team_open_invitations in team_services.py returns MembershipInvitation dictionaries, not MembershipRequest.

Testing:

  • python -m pytest -q tests/unit/synapseclient/models/async/unit_test_team_async.py — 13 passed (added test_delete_invitation).
  • Ensure that documentation gets built and formatted correctly.

🤖 Generated with Claude Code

@linglp linglp changed the title Add docstring examples to Team model and protocol methods fix: Add docstring examples to Team model and protocol methods Sep 23, 2026
@linglp linglp changed the title fix: Add docstring examples to Team model and protocol methods fix: Add Team docstring examples, delete_invitation method, and complete mkdocs reference Sep 23, 2026
@linglp
linglp marked this pull request as ready for review September 24, 2026 22:01
@linglp
linglp requested a review from a team as a code owner September 24, 2026 22:01
Copilot AI lite review requested due to automatic review settings September 24, 2026 22:01

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.

Copilot review overview

🟢 Approval recommended

The remaining documentation wording nit is non-blocking.

Review effort: Lite
Findings: None

What changed in this PR

Adds Team documentation examples, exposes invitation deletion, and completes MkDocs references.

Changes:

  • Added sync/async Team docstring examples.
  • Added delete_invitation methods and test coverage.
  • Updated Team reference pages and invitation documentation.
File Summary
tests/​unit/​synapseclient/​models/​async/​unit_test_team_async.py Added invitation deletion test.
synapseclient/​models/​team.py Added Team examples and invitation deletion wrapper.
synapseclient/​models/​protocols/​team_protocol.py Added protocol method and examples.
synapseclient/​api/​team_services.py Corrected invitation return documentation; summary wording still needs alignment.
docs/​reference/​experimental/​sync/​team.md Added missing sync members.
docs/​reference/​experimental/​async/​team.md Added missing async members.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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.

Thank you for fixing these!

@linglp
linglp merged commit 781d5ef into develop Sep 25, 2026
22 of 24 checks passed
@linglp
linglp deleted the fix-team-docstring branch September 25, 2026 00:27
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