Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions debiai_data_provider/controller/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ async def get_data_id_list(
)
def get_data(
projectId: str = Path(..., min_length=1, example="Project 1"),
analysisId: Optional[str] = Query(None),
analysisStart: Optional[bool] = Query(None),
analysisEnd: Optional[bool] = Query(None),
sampleIds: List[Union[str, int, float]] = Body(..., embed=True),
data_provider: DataProvider = Depends(get_data_provider),
):
Expand Down
12 changes: 8 additions & 4 deletions debiai_data_provider/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_nb_samples(self) -> Union[int, None]:
def get_samples_ids(self) -> List[str]:
raise NotImplementedError

def get_data(self, samples_ids: List[str]) -> pd.DataFrame:
def get_data(self, samples_ids: List[Union[str, int, float]]) -> pd.DataFrame:
raise NotImplementedError

# Project models
Expand All @@ -43,7 +43,9 @@ def get_models(self) -> List[ModelDetail]:
def get_model_evaluated_data_id_list(self, model_id: str) -> List[str]:
raise NotImplementedError

def get_model_results(self, model_id: str, sample_ids: List[str]) -> pd.DataFrame:
def get_model_results(
self, model_id: str, sample_ids: List[Union[str, int, float]]
) -> pd.DataFrame:
raise NotImplementedError


Expand All @@ -64,6 +66,7 @@ def get_columns(self) -> Union[List[Column], None]:

structure = structure.copy()

# Validate structure
for key, value in structure.items():
if not isinstance(value, dict):
raise ValueError(
Expand Down Expand Up @@ -115,6 +118,7 @@ def get_columns(self) -> Union[List[Column], None]:
# "type": "text",
# "category": "context",
# "group": "context",
# "metrics": {},
# },
# ...
# }
Expand All @@ -132,7 +136,7 @@ def get_columns(self) -> Union[List[Column], None]:
"category": value["category"],
"group": value.get("group", ""),
},
metrics={},
metrics=value.get("metrics", {}),
tags=[],
type=value["type"],
)
Expand Down Expand Up @@ -321,7 +325,7 @@ def get_data_id_list(

return samples_ids

def get_data_from_ids(self, samples_ids: List[str]) -> dict:
def get_data_from_ids(self, samples_ids: List[Union[str, int, float]]) -> dict:
from debiai_data_provider.utils.parser import dataframe_to_debiai_data_array

# Get the data from the project
Expand Down
2 changes: 1 addition & 1 deletion debiai_data_provider/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.1.4"
VERSION = "1.1.6"