Skip to content

feat(services): F2D annotations slice 7 — extract get_go_subgraph BFS#40

Merged
frapercan merged 1 commit intodevelopfrom
feat/f2d-annotations-final-extracts
May 8, 2026
Merged

feat(services): F2D annotations slice 7 — extract get_go_subgraph BFS#40
frapercan merged 1 commit intodevelopfrom
feat/f2d-annotations-final-extracts

Conversation

@frapercan
Copy link
Copy Markdown
Owner

GO subgraph BFS endpoint moves to the service. Router 683 → 617 LOC. Local-first: ruff/flake8/mypy clean, 1160 pytest pass.

Migrates the GO subgraph BFS endpoint into the service:

- ``get_go_subgraph_data(session, snapshot_id, go_ids, depth)``
  parses the comma-separated GO ids, resolves seed terms, then
  walks ``GOTermRelationship`` upward up to ``depth`` levels.
  Returns ``{"nodes": [...], "edges": [...]}`` with ``is_query``
  flagged on the seed terms. Raises ``EntityNotFoundError`` when
  the OntologySnapshot does not resolve.
- Router endpoint reduces from ~70 LOC body to a 6-LOC shim.

The ``GOTermRelationship`` import was lifted into the service
(local within the function); the router no longer needs to import
the relationship ORM. Removes the now-unused ``GOTermRelationship``
import from the router via ruff's auto-fix.

Sizes: annotations router 683 → 617 LOC. Local-first verified:
ruff + flake8 + mypy clean, 1160 pytest passed.
@frapercan frapercan enabled auto-merge (squash) May 8, 2026 00:50
@frapercan frapercan merged commit a242eb6 into develop May 8, 2026
12 checks passed
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.

1 participant