Skip to content

Commit

Permalink
Small refactor 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Aug 21, 2024
1 parent 724215a commit 52a2968
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions src/neptune_scale/api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
)
from neptune_api.api.backend import get_client_config
from neptune_api.api.data_ingestion import (
check_request_status,
check_request_status_bulk,
submit_operation,
)
Expand Down Expand Up @@ -108,9 +107,6 @@ class ApiClient(Resource, abc.ABC):
@abc.abstractmethod
def submit(self, operation: RunOperation, family: str) -> Response[RequestId]: ...

@abc.abstractmethod
def check(self, request_id: str, project: str) -> Response[RequestStatus]: ...

@abc.abstractmethod
def check_batch(self, request_ids: list[str], project: str) -> Response[BulkRequestStatus]: ...

Expand All @@ -131,13 +127,6 @@ def __init__(self, api_token: str) -> None:
def submit(self, operation: RunOperation, family: str) -> Response[RequestId]:
return submit_operation.sync_detailed(client=self._backend, body=operation, family=family)

def check(self, request_id: str, project: str) -> Response[RequestStatus]:
return check_request_status.sync_detailed(
client=self._backend,
project_identifier=project,
request_id=request_id,
)

def check_batch(self, request_ids: list[str], project: str) -> Response[BulkRequestStatus]:
return check_request_status_bulk.sync_detailed(
client=self._backend,
Expand All @@ -157,10 +146,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
def submit(self, operation: RunOperation, family: str) -> Response[RequestId]:
return Response(content=b"", parsed=RequestId(value=str(uuid.uuid4())), status_code=HTTPStatus.OK, headers={})

def check(self, request_id: str, project: str) -> Response[RequestStatus]:
status = RequestStatus(code_by_count=[RequestStatus.CodeByCount(count=1, code=Code.OK)])
return Response(content=b"", parsed=status, status_code=HTTPStatus.OK, headers={})

def check_batch(self, request_ids: list[str], project: str) -> Response[BulkRequestStatus]:
response_body = BulkRequestStatus(
statuses=list(
Expand Down
2 changes: 1 addition & 1 deletion src/neptune_scale/core/components/sync_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def submit(self, *, operation: RunOperation) -> Optional[RequestId]:
def work(self) -> None:
while (operation := self.get_next()) is not None:
self._latest_unprocessed = operation
sequence_id, occured_at, data = operation
sequence_id, timestamp, data = operation

try:
run_operation = RunOperation()
Expand Down

0 comments on commit 52a2968

Please sign in to comment.