Skip to content

Commit

Permalink
feat(tb): Remove unused function (#2648)
Browse files Browse the repository at this point in the history
### Changed

- Remove unused function in Trailblazer API
  • Loading branch information
henrikstranneheim authored Nov 7, 2023
1 parent fef847d commit c5fe5ef
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions cg/apps/tb/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
""" Trailblazer API for cg """ ""
""" Trailblazer API for cg."""
import datetime
import datetime as dt
import logging
from typing import Any, Optional

Expand Down Expand Up @@ -67,37 +66,6 @@ def query_trailblazer(
LOG.debug(f"RESPONSE BODY {response.text}")
return ReadStream.get_content_from_stream(file_format=FileFormat.JSON, stream=response.text)

def analyses(
self,
case_id: str = None,
query: str = None,
status: str = None,
deleted: bool = None,
temp: bool = False,
before: dt.datetime = None,
is_visible: bool = None,
family: str = None,
data_analysis: Pipeline = None,
) -> list:
request_body = {
"case_id": case_id,
"status": status,
"query": query,
"deleted": deleted,
"temp": temp,
"before": str(before) if before else None,
"is_visible": is_visible,
"family": family,
"data_analysis": data_analysis.upper() if data_analysis else None,
}
response = self.query_trailblazer(command="query-analyses", request_body=request_body)
if response:
if isinstance(response, list):
return [TrailblazerAnalysis.model_validate(analysis) for analysis in response]
if isinstance(response, dict):
return [TrailblazerAnalysis.model_validate(response)]
return response

def get_latest_analysis(self, case_id: str) -> Optional[TrailblazerAnalysis]:
request_body = {
"case_id": case_id,
Expand Down

0 comments on commit c5fe5ef

Please sign in to comment.