From 2439879076a56dea5f1b19e7d03ce90acb142066 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Mon, 17 Jun 2024 12:18:43 -0700 Subject: [PATCH] Removed deprecated np.float_ and update NumPy/Pandas imports Signed-off-by: saimedhi --- CHANGELOG.md | 1 + dev-requirements.txt | 5 ++--- opensearchpy/serializer.py | 1 - test_opensearchpy/test_serializer.py | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de67cc57..724648a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] ### Added ### Changed +- Removed deprecated np.float_ and update NumPy/Pandas imports ([#762](https://github.com/opensearch-project/opensearch-py/pull/762)) ### Deprecated ### Removed ### Fixed diff --git a/dev-requirements.txt b/dev-requirements.txt index 580ed7ee9..979bc04a5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -11,9 +11,8 @@ deepmerge Events setuptools -# No wheels for Python 3.10 yet! -numpy; python_version<"3.10" -pandas; python_version<"3.10" +numpy; python_version<="3.12" +pandas; python_version<="3.12" pyyaml>=5.4 diff --git a/opensearchpy/serializer.py b/opensearchpy/serializer.py index e5c0a6c91..d16c287e3 100644 --- a/opensearchpy/serializer.py +++ b/opensearchpy/serializer.py @@ -111,7 +111,6 @@ def default(self, data: Any) -> Any: elif isinstance( data, ( - np.float_, np.float16, np.float32, np.float64, diff --git a/test_opensearchpy/test_serializer.py b/test_opensearchpy/test_serializer.py index 524887d03..c0f223ad2 100644 --- a/test_opensearchpy/test_serializer.py +++ b/test_opensearchpy/test_serializer.py @@ -106,7 +106,6 @@ def test_serializes_numpy_floats(self) -> None: ser = JSONSerializer() for np_type in ( - np.float_, np.float32, np.float64, ):