From ec98964e94721197f5df2947668a5f5a50384453 Mon Sep 17 00:00:00 2001 From: Andy Shirey Date: Mon, 25 Nov 2024 20:48:15 -0800 Subject: [PATCH 1/2] rename DenseVector/dense_vector field type to KnnVector/knn_vector --- opensearchpy/__init__.py | 4 ++-- opensearchpy/helpers/field.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opensearchpy/__init__.py b/opensearchpy/__init__.py index 94b6d056..0b37e275 100644 --- a/opensearchpy/__init__.py +++ b/opensearchpy/__init__.py @@ -92,7 +92,7 @@ CustomField, Date, DateRange, - DenseVector, + KnnVector, Double, DoubleRange, Field, @@ -178,7 +178,7 @@ "Date", "DateHistogramFacet", "DateRange", - "DenseVector", + "KnnVector", "Document", "Double", "DoubleRange", diff --git a/opensearchpy/helpers/field.py b/opensearchpy/helpers/field.py index e41aa46d..ef34d5f0 100644 --- a/opensearchpy/helpers/field.py +++ b/opensearchpy/helpers/field.py @@ -354,8 +354,8 @@ def _deserialize(self, data: Any) -> Any: return float(data) -class DenseVector(Float): - name: Optional[str] = "dense_vector" +class KnnVector(Float): + name: Optional[str] = "knn_vector" def __init__(self, dims: Any, **kwargs: Any) -> None: kwargs["multi"] = True From 969355720a626a857c32d74dc2d2032d0158ad00 Mon Sep 17 00:00:00 2001 From: Andy Shirey Date: Mon, 25 Nov 2024 20:58:19 -0800 Subject: [PATCH 2/2] rename DenseVector/dense_vector field type to KnnVector/knn_vector (add to changelog) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2691b252..fef42949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `pool_maxsize` to `AsyncOpenSearch` ([845](https://github.com/opensearch-project/opensearch-py/pull/845)) - Added `ssl_assert_hostname` to `AsyncOpenSearch` ([843](https://github.com/opensearch-project/opensearch-py/pull/843)) ### Changed +- Rename `DenseVector` field type to `KnnVector` ([853](https://github.com/opensearch-project/opensearch-py/pull/853)) ### Deprecated ### Removed ### Updated APIs