diff --git a/CHANGELOG.md b/CHANGELOG.md index 032f6ed234..4146bb7968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ These are the section headers that we use: - Fixed parsing ranking values in suggestions from HF datasets. ([#4629](https://github.com/argilla-io/argilla/pull/4629)) - Fixed reading description from API response payload. ([#4632](https://github.com/argilla-io/argilla/pull/4632)) - Fixed pulling (n*chunk_size)+1 records when using `ds.pull` or iterating over the dataset. ([#4662](https://github.com/argilla-io/argilla/pull/4662)) +- Fixed client's resolution of enum values when calling the Search and Metrics api, to support Python >=3.11 enum handling. ([#4672](https://github.com/argilla-io/argilla/pull/4672)) ## [1.25.0](https://github.com/argilla-io/argilla/compare/v1.24.0...v1.25.0) diff --git a/src/argilla/client/apis/metrics.py b/src/argilla/client/apis/metrics.py index abb4cf88d2..3b5ae6f62b 100644 --- a/src/argilla/client/apis/metrics.py +++ b/src/argilla/client/apis/metrics.py @@ -29,7 +29,7 @@ def metric_summary( query: Optional[str] = None, **metric_params, ): - url = self._API_URL_PATTERN.format(task=task, name=name, metric=metric) + url = self._API_URL_PATTERN.format(task=task.value, name=name, metric=metric) metric_params = metric_params or {} query_params = {k: v for k, v in metric_params.items() if v is not None} if query_params: diff --git a/src/argilla/client/apis/search.py b/src/argilla/client/apis/search.py index 7567c78030..665e272363 100644 --- a/src/argilla/client/apis/search.py +++ b/src/argilla/client/apis/search.py @@ -68,7 +68,7 @@ def search_records( else: raise ValueError(f"Task {task} not supported") - url = self._API_URL_PATTERN.format(name=name, task=task) + url = Search._API_URL_PATTERN.format(name=name, task=task.value) if size: url += f"?limit={size}"