|
2 | 2 | import os |
3 | 3 | import urllib |
4 | 4 | from collections.abc import Callable |
5 | | -from dataclasses import dataclass |
| 5 | +from dataclasses import dataclass, field |
6 | 6 | from datetime import datetime, timezone |
7 | 7 | from functools import partial |
8 | 8 | from os import PathLike |
@@ -356,17 +356,9 @@ class ModelSourceRepo(BaseModel): |
356 | 356 | class SyncResult: |
357 | 357 | """Result of a sync operation.""" |
358 | 358 |
|
359 | | - synced: list[tuple[str, str]] = None # [(source, ref), ...] |
360 | | - skipped: list[tuple[str, str]] = None # [(ref, reason), ...] |
361 | | - failed: list[tuple[str, str]] = None # [(ref, error), ...] |
362 | | - |
363 | | - def __post_init__(self): |
364 | | - if self.synced is None: |
365 | | - self.synced = [] |
366 | | - if self.skipped is None: |
367 | | - self.skipped = [] |
368 | | - if self.failed is None: |
369 | | - self.failed = [] |
| 359 | + synced: list[tuple[str, str]] = field(default_factory=list) # [(source, ref), ...] |
| 360 | + skipped: list[tuple[str, str]] = field(default_factory=list) # [(ref, reason), ...] |
| 361 | + failed: list[tuple[str, str]] = field(default_factory=list) # [(ref, error), ...] |
370 | 362 |
|
371 | 363 | @dataclass |
372 | 364 | class SyncStatus: |
|
0 commit comments