Skip to content

Commit

Permalink
thanks coderabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed Nov 8, 2024
1 parent 706879d commit 21172e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions fiftyone/factory/repo_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pymongo.database import Database

from bson import ObjectId
import bson
from typing import Optional
import fiftyone.core.odm as foo
from fiftyone.factory.repos.delegated_operation import (
Expand Down Expand Up @@ -53,7 +53,7 @@ def delegated_operation_repo() -> DelegatedOperationRepo:

@staticmethod
def execution_store_repo(
dataset_id: Optional[str] = None,
dataset_id: Optional[bson.ObjectId] = None,
) -> ExecutionStoreRepo:
"""Factory method for execution store repository."""
if (
Expand Down
17 changes: 9 additions & 8 deletions fiftyone/operators/store/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
|
"""

import bson
import logging
from typing import Optional, List
from fiftyone.operators.store.models import StoreDocument, KeyDocument
Expand All @@ -14,13 +15,17 @@


class ExecutionStoreService:
"""Service for managing execution store operations."""

def __init__(
self,
repo: Optional["ExecutionStoreRepo"] = None,
dataset_id: Optional[str] = None,
dataset_id: Optional[bson.ObjectId] = None,
):
"""Service for managing execution store operations.
Args:
repo: Optional execution store repository instance
dataset_id: Optional bson.ObjectId of the dataset to scope operations to
"""
from fiftyone.factory.repo_factory import (
RepositoryFactory,
ExecutionStoreRepo,
Expand Down Expand Up @@ -134,9 +139,5 @@ def list_keys(self, store_name: str) -> List[str]:
return self._repo.list_keys(store_name)

def cleanup_for_dataset(self) -> None:
"""Cleans up the execution store for the specified dataset.
Args:
dataset_id: the ID of the dataset
"""
"""Cleans up the execution store for the dataset specified during initialization."""
self._repo.cleanup_for_dataset()

0 comments on commit 21172e2

Please sign in to comment.