lablup / lablup/backend.ai

Migrate PartialModifier to Updater pattern

Open
#7,284 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

## Overview

Replace the legacy `PartialModifier` class in `src/ai/backend/manager/types.py` with the new `Updater` pattern from `src/ai/backend/manager/repositories/base/updater.py`.

## Current State

The `PartialModifier` class in `types.py` is an abstract base class used for partial update operations:

```python
class PartialModifier(ABC):
@abstractmethod
def fields_to_update(self) -> dict[str, Any]:
"""Returns a dictionary of fields that should be updated."""
pass
```

## Target State

Use the new `Updater` and `UpdaterSpec` pattern with `execute_updater` function from `repositories/base/updater.py` for consistency with other repository patterns (Creator, Querier, Purger).

## Tasks

- [ ] Identify all usages of `PartialModifier` in the codebase
- [ ] Migrate each usage to `UpdaterSpec` / `Updater` pattern
- [ ] Update tests accordingly
- [ ] Remove legacy `PartialModifier` class from `types.py`

## Related

- Parent Epic: BA-3345
- Similar migration for Creator: BA-3348

JIRA Issue: BA-3352

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.