Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/datachain/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ def cleanup_dataset_versions(self, job_id: str | None = None) -> int:
Clean up dataset versions that are no longer needed.

Removes dataset versions that:
- Have status CREATED, FAILED, STALE, or REMOVING
- Have status CREATED, FAILED, or REMOVING
- Belong to completed/failed/canceled jobs (not running)
Comment on lines 1157 to 1159
- Are session_* datasets from finished jobs (orphaned intermediates)

Expand Down
5 changes: 2 additions & 3 deletions src/datachain/data_storage/metastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def get_dataset_versions_to_clean(
job (used during job failure cleanup).

When job_id is None, returns all versions that are safe to delete:
- Status CREATED, FAILED, STALE where either:
- Status CREATED, FAILED where either:
- the associated job has finished, or
- there is no associated job (job_id is NULL) and the version is
older than STALE_CREATED_THRESHOLD_HOURS
Expand Down Expand Up @@ -1831,13 +1831,12 @@ def get_dataset_versions_to_clean(
)
.where(
or_(
# Incomplete/failed/stale versions from finished jobs
# Incomplete/failed versions from finished jobs
and_(
dv.c.status.in_(
[
DatasetStatus.CREATED,
DatasetStatus.FAILED,
DatasetStatus.STALE,
DatasetStatus.REMOVING,
Comment on lines 1836 to 1840
]
),
Expand Down
3 changes: 0 additions & 3 deletions src/datachain/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,8 @@ def __hash__(self):

class DatasetStatus:
CREATED = 1
PENDING = 2
FAILED = 3
COMPLETE = 4
STALE = 6
REMOVING = 7
Comment on lines 261 to 265


Expand Down Expand Up @@ -371,7 +369,6 @@ def is_final_status(self) -> bool:
return self.status in [
DatasetStatus.FAILED,
DatasetStatus.COMPLETE,
DatasetStatus.STALE,
DatasetStatus.REMOVING,
]
Comment on lines 369 to 373

Expand Down
Loading