lablup / lablup/backend.ai

Remove SQLAlchemy ORM relationships from Row classes

Open
#13,512 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Remove SQLAlchemy ORM relationship() definitions from Row classes in the manager models.

## Background

- Row usage has been isolated behind the repository/db_source layers, and the ops pattern (Querier/Creator/Updater/Purger) fetches related data with explicit queries, so ORM relationships are no longer needed.
- Some test cases fail solely because of relationship definitions (mapper configuration/reference issues), so removing them also stabilizes the test suite.

## Scope

- Inventory all relationship() definitions in Row classes and their remaining usages.
- Replace remaining usages with explicit queries via the repository/ops layer.
- Remove the relationship() definitions and related loader options (selectinload/joinedload) that depend on them.

JIRA Issue: BA-7222

Contributor guide

Open the contributing guide

Research direction

Start by inventorying relationship() definitions in the manager model Row classes and tracing their remaining usages through the repository/db_source layers and Querier/Creator/Updater/Purger ops. Check the related tests and loader options such as selectinload and joinedload. Done means remaining accesses use explicit repository or ops queries, relationship definitions and dependent loaders are removed, and the affected tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
backend, databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.