diff --git a/.ci/run-tests b/.ci/run-tests index 258da8a5..286a0440 100755 --- a/.ci/run-tests +++ b/.ci/run-tests @@ -5,7 +5,7 @@ # Default environment variables export TEST_SUITE="${TEST_SUITE:=oss}" export PYTHON_VERSION="${PYTHON_VERSION:=3.9}" -export PANDAS_VERSION=${PANDAS_VERSION-1.5.0} +export PANDAS_VERSION=${PANDAS_VERSION-2.0.3} export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}" export CLUSTER="${1:-opensearch}" export SECURE_INTEGRATION="${2:-true}" diff --git a/CHANGELOG.md b/CHANGELOG.md index cc0a009f..aede259a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Replaced usage of `is_datetime_or_timedelta_dtype` with `is_timedelta64_dtype` and `is_datetime64_any_dtype` by @rawwar ([#316](https://github.com/opensearch-project/opensearch-py-ml/pull/316)) - use try-except-else block for handling unexpected exceptions during integration tests by @rawwar([#370](https://github.com/opensearch-project/opensearch-py-ml/pull/370)) - Removed pandas version pin in nox tests by @rawwar ([#368](https://github.com/opensearch-project/opensearch-py-ml/pull/368)) +- Upgraded pandas version by @yerzhaisang ([#373](https://github.com/opensearch-project/opensearch-py-ml/pull/373)) +- Removed pandas deprecated methods such as mad, _construct_axes_from_arguments and unused keyword arguments by @yerzhaisang ([#373](https://github.com/opensearch-project/opensearch-py-ml/pull/373)) ### Fixed - Enable make_model_config_json to add model description to model config file by @thanawan-atc in ([#203](https://github.com/opensearch-project/opensearch-py-ml/pull/203)) diff --git a/Command b/Command new file mode 100644 index 00000000..e69de29b diff --git a/Session b/Session new file mode 100644 index 00000000..e69de29b diff --git a/opensearch_py_ml/dataframe.py b/opensearch_py_ml/dataframe.py index 64772887..d12c5aa3 100644 --- a/opensearch_py_ml/dataframe.py +++ b/opensearch_py_ml/dataframe.py @@ -424,9 +424,7 @@ def drop( axis = pd.DataFrame._get_axis_name(axis) axes = {axis: labels} elif index is not None or columns is not None: - axes, _ = pd.DataFrame()._construct_axes_from_arguments( - (index, columns), {} - ) + axes = {"index": index, "columns": columns} else: raise ValueError( "Need to specify at least one of 'labels', 'index' or 'columns'" @@ -1355,7 +1353,7 @@ def to_csv( "compression": compression, "quoting": quoting, "quotechar": quotechar, - "line_terminator": line_terminator, + # "line_terminator": line_terminator, "chunksize": chunksize, "date_format": date_format, "doublequote": doublequote, diff --git a/requirements-dev.txt b/requirements-dev.txt index 16640f77..fe5d8a26 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # # Basic requirements # -pandas>=1.5.2,<2 +pandas>=2.0.3 matplotlib>=3.6.2,<4 numpy>=1.24.0,<2 opensearch-py>=2.2.0 diff --git a/requirements.txt b/requirements.txt index ab4e9482..f535e66b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # # Basic requirements # -pandas>=1.5.2,<2 +pandas>=2.0.3 matplotlib>=3.6.2,<4 numpy>=1.24.0,<2 opensearch-py>=2.2.0 diff --git a/tests/common.py b/tests/common.py index f332b0f6..61378609 100644 --- a/tests/common.py +++ b/tests/common.py @@ -25,6 +25,7 @@ import os from datetime import timedelta +import numpy as np import pandas as pd from pandas.testing import assert_frame_equal, assert_series_equal @@ -151,3 +152,19 @@ def assert_almost_equal(left, right, **kwargs): assert left is pd.NaT else: assert left == right, f"{left} != {right}" + + +def mad(x): + if isinstance(x, pd.Series): + if x.dtype == "