Skip to content

Commit

Permalink
FIX-#2369: Update pandas version to 1.1.4 (#2371)
Browse files Browse the repository at this point in the history
Signed-off-by: Igoshev, Yaroslav <yaroslav.igoshev@intel.com>
  • Loading branch information
YarShev authored Nov 5, 2020
1 parent f4f3a1e commit fc34852
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 114 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: modin
channels:
- conda-forge
dependencies:
- pandas==1.1.3
- pandas==1.1.4
- numpy
- pyarrow==1.0
- dask[complete]>=2.12.0,<=2.19.0
Expand Down
4 changes: 2 additions & 2 deletions modin/engines/base/io/file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ def file_exists(cls, file_path):
return os.path.exists(file_path)

@classmethod
def deploy(cls, func, args, num_return_vals):
def deploy(cls, func, args, num_returns):
raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)

def parse(self, func, args, num_return_vals):
def parse(self, func, args, num_returns):
raise NotImplementedError(NOT_IMPLEMENTED_MESSAGE)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions modin/engines/dask/task_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

class DaskTask:
@classmethod
def deploy(cls, func, num_return_vals, kwargs):
def deploy(cls, func, num_returns, kwargs):
client = _get_global_client()
remote_task_future = client.submit(func, **kwargs)
return [
client.submit(lambda l, i: l[i], remote_task_future, i)
for i in range(num_return_vals)
for i in range(num_returns)
]

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion modin/experimental/engines/pandas_on_ray/io_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def read_sql(
columns,
chunksize,
),
num_return_vals=num_splits + 1,
num_returns=num_splits + 1,
)
partition_ids.append(
[PandasOnRayFramePartition(obj) for obj in partition_id[:-1]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def apply(self, func, num_splits=None, other_axis_partition=None, **kwargs):
for obj in deploy_ray_func_between_two_axis_partitions._remote(
args=(self.axis, func, num_splits, len(self.list_of_blocks), kwargs)
+ tuple(self.list_of_blocks + other_axis_partition.list_of_blocks),
num_return_vals=num_splits,
num_returns=num_splits,
)
]

args = [self.axis, func, num_splits, kwargs]
args.extend(self.list_of_blocks)
return [
PyarrowOnRayFramePartition(obj)
for obj in deploy_ray_axis_func._remote(args, num_return_vals=num_splits)
for obj in deploy_ray_axis_func._remote(args, num_returns=num_splits)
]

def shuffle(self, func, num_splits=None, **kwargs):
Expand All @@ -74,7 +74,7 @@ def shuffle(self, func, num_splits=None, **kwargs):
args.extend(self.list_of_blocks)
return [
PyarrowOnRayFramePartition(obj)
for obj in deploy_ray_axis_func._remote(args, num_return_vals=num_splits)
for obj in deploy_ray_axis_func._remote(args, num_returns=num_splits)
]


Expand Down
2 changes: 1 addition & 1 deletion modin/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import pandas

__pandas_version__ = "1.1.3"
__pandas_version__ = "1.1.4"

if pandas.__version__ != __pandas_version__:
import warnings
Expand Down
6 changes: 0 additions & 6 deletions modin/pandas/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,6 @@ def add(self, other, axis="columns", level=None, fill_value=None):
)

def aggregate(self, func=None, axis=0, *args, **kwargs):
warnings.warn(
"Modin index may not match pandas index due to pandas issue pandas-dev/pandas#36189."
)
axis = self._get_axis_number(axis)
result = None

Expand Down Expand Up @@ -686,9 +683,6 @@ def apply(
args=(),
**kwds,
):
warnings.warn(
"Modin index may not match pandas index due to pandas issue pandas-dev/pandas#36189."
)
axis = self._get_axis_number(axis)
ErrorMessage.non_verified_udf()
if isinstance(func, str):
Expand Down
16 changes: 1 addition & 15 deletions modin/pandas/test/dataframe/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_math_alias(math_op, alias):
assert getattr(pd.DataFrame, math_op) == getattr(pd.DataFrame, alias)


@pytest.mark.parametrize("other", ["as_left", 4, 4.0])
@pytest.mark.parametrize("other", ["as_left", 4, 4.0, "a"])
@pytest.mark.parametrize("op", ["eq", "ge", "gt", "le", "lt", "ne"])
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
def test_comparison(data, op, other):
Expand All @@ -145,20 +145,6 @@ def test_comparison(data, op, other):
)


@pytest.mark.xfail_backends(
["BaseOnPython"],
reason="Test is failing because of mismathing of thrown exceptions. See pandas issue #36377",
)
@pytest.mark.parametrize("other", ["a"])
@pytest.mark.parametrize("op", ["ge", "gt", "le", "lt", "eq", "ne"])
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
def test_comparison_except(data, op, other):
eval_general(
*create_test_dfs(data),
lambda df: getattr(df, op)(other),
)


@pytest.mark.parametrize("op", ["eq", "ge", "gt", "le", "lt", "ne"])
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
def test_multi_level_comparison(data, op):
Expand Down
28 changes: 8 additions & 20 deletions modin/pandas/test/dataframe/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,10 @@
)
@pytest.mark.parametrize("op", ["agg", "apply"])
def test_agg_apply(axis, func, op):
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_dfs(test_data["float_nan_data"]),
lambda df: getattr(df, op)(func, axis),
)
except AssertionError:
pass
eval_general(
*create_test_dfs(test_data["float_nan_data"]),
lambda df: getattr(df, op)(func, axis),
)


@pytest.mark.parametrize("axis", ["rows", "columns"])
Expand All @@ -69,16 +63,10 @@ def test_agg_apply(axis, func, op):
)
@pytest.mark.parametrize("op", ["agg", "apply"])
def test_agg_apply_axis_names(axis, func, op):
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_dfs(test_data["int_data"]),
lambda df: getattr(df, op)(func, axis),
)
except AssertionError:
pass
eval_general(
*create_test_dfs(test_data["int_data"]),
lambda df: getattr(df, op)(func, axis),
)


def test_aggregate_alias():
Expand Down
84 changes: 24 additions & 60 deletions modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,10 @@ def test_add_suffix(data):
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
@pytest.mark.parametrize("func", agg_func_values, ids=agg_func_keys)
def test_agg(data, func):
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.agg(func),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.agg(func),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand All @@ -624,16 +618,10 @@ def test_agg_numeric(request, data, func):
request.node.name, numeric_dfs
):
axis = 0
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.agg(func, axis),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.agg(func, axis),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand All @@ -656,16 +644,10 @@ def test_agg_numeric_except(request, data, func):
@pytest.mark.parametrize("func", agg_func_values, ids=agg_func_keys)
def test_aggregate(data, func):
axis = 0
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.aggregate(func, axis),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.aggregate(func, axis),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand All @@ -688,16 +670,10 @@ def test_aggregate_numeric(request, data, func):
request.node.name, numeric_dfs
):
axis = 0
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.agg(func, axis),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.agg(func, axis),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand Down Expand Up @@ -823,16 +799,10 @@ def test_append(data):
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
@pytest.mark.parametrize("func", agg_func_values, ids=agg_func_keys)
def test_apply(data, func):
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.apply(func),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.apply(func),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand Down Expand Up @@ -871,16 +841,10 @@ def test_apply_external_lib():
@pytest.mark.parametrize("func", agg_func_values, ids=agg_func_keys)
def test_apply_numeric(request, data, func):
if name_contains(request.node.name, numeric_dfs):
# AssertionError may be arisen in case of
# mismathing of index/columns in Modin and pandas.
# See details in pandas issue 36189.
try:
eval_general(
*create_test_series(data),
lambda df: df.apply(func),
)
except AssertionError:
pass
eval_general(
*create_test_series(data),
lambda df: df.apply(func),
)


@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas==1.1.3
pandas==1.1.4
numpy
pyarrow==1.0
dask[complete]>=2.12.0,<=2.19.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/env_omnisci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- intel/label/modin
- conda-forge
dependencies:
- pandas==1.1.3
- pandas==1.1.4
- pyarrow==1.0
- numpy
- pip
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def is_pure(self):
url="https://github.com/modin-project/modin",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=["pandas==1.1.3", "packaging"],
install_requires=["pandas==1.1.4", "packaging"],
extras_require={
# can be installed by pip install modin[dask]
"dask": dask_deps,
Expand Down

0 comments on commit fc34852

Please sign in to comment.