diff --git a/distributed/protocol/pickle.py b/distributed/protocol/pickle.py index 90f0fa3f88f..8b4b7328e5b 100644 --- a/distributed/protocol/pickle.py +++ b/distributed/protocol/pickle.py @@ -10,7 +10,7 @@ from distributed.protocol.serialize import dask_deserialize, dask_serialize -CLOUDPICKLE_GTE_20 = parse_version(cloudpickle.__version__) >= parse_version("2.0.0") +CLOUDPICKLE_GE_20 = parse_version(cloudpickle.__version__) >= parse_version("2.0.0") HIGHEST_PROTOCOL = pickle.HIGHEST_PROTOCOL @@ -68,7 +68,7 @@ def dumps(x, *, buffer_callback=None, protocol=HIGHEST_PROTOCOL): pickler.dump(x) result = f.getvalue() if b"__main__" in result or ( - CLOUDPICKLE_GTE_20 + CLOUDPICKLE_GE_20 and getattr(inspect.getmodule(x), "__name__", None) in cloudpickle.list_registry_pickle_by_value() ): diff --git a/distributed/protocol/tests/test_pickle.py b/distributed/protocol/tests/test_pickle.py index 52b5649cae3..611c95a07fb 100644 --- a/distributed/protocol/tests/test_pickle.py +++ b/distributed/protocol/tests/test_pickle.py @@ -14,7 +14,7 @@ from distributed import profile from distributed.protocol import deserialize, serialize from distributed.protocol.pickle import ( - CLOUDPICKLE_GTE_20, + CLOUDPICKLE_GE_20, HIGHEST_PROTOCOL, dumps, loads, @@ -201,7 +201,7 @@ def funcs(): @pytest.mark.skipif( - not CLOUDPICKLE_GTE_20, reason="Pickle by value registration not supported" + not CLOUDPICKLE_GE_20, reason="Pickle by value registration not supported" ) def test_pickle_by_value_when_registered(): with save_sys_modules(): diff --git a/distributed/shuffle/tests/test_merge.py b/distributed/shuffle/tests/test_merge.py index 4ea17c6df1d..99e4c32d65c 100644 --- a/distributed/shuffle/tests/test_merge.py +++ b/distributed/shuffle/tests/test_merge.py @@ -9,7 +9,7 @@ dd = pytest.importorskip("dask.dataframe") import pandas as pd -from dask.dataframe._compat import PANDAS_GT_200, tm +from dask.dataframe._compat import PANDAS_GE_200, tm from dask.dataframe.utils import assert_eq from dask.utils_test import hlg_layer_topological @@ -249,7 +249,7 @@ async def test_merge_by_multiple_columns(c, s, a, b, how): # FIXME: There's an discrepancy with an empty index for # pandas=2.0 (xref https://github.com/dask/dask/issues/9957). # Temporarily avoid index check until the discrepancy is fixed. - check_index=not (PANDAS_GT_200 and expected.index.empty), + check_index=not (PANDAS_GE_200 and expected.index.empty), ) expected = pdr.join(pdl, how=how) @@ -259,7 +259,7 @@ async def test_merge_by_multiple_columns(c, s, a, b, how): # FIXME: There's an discrepancy with an empty index for # pandas=2.0 (xref https://github.com/dask/dask/issues/9957). # Temporarily avoid index check until the discrepancy is fixed. - check_index=not (PANDAS_GT_200 and expected.index.empty), + check_index=not (PANDAS_GE_200 and expected.index.empty), ) expected = pd.merge(pdl, pdr, how=how, left_index=True, right_index=True) @@ -278,7 +278,7 @@ async def test_merge_by_multiple_columns(c, s, a, b, how): # FIXME: There's an discrepancy with an empty index for # pandas=2.0 (xref https://github.com/dask/dask/issues/9957). # Temporarily avoid index check until the discrepancy is fixed. - check_index=not (PANDAS_GT_200 and expected.index.empty), + check_index=not (PANDAS_GE_200 and expected.index.empty), ) expected = pd.merge(pdr, pdl, how=how, left_index=True, right_index=True) @@ -297,7 +297,7 @@ async def test_merge_by_multiple_columns(c, s, a, b, how): # FIXME: There's an discrepancy with an empty index for # pandas=2.0 (xref https://github.com/dask/dask/issues/9957). # Temporarily avoid index check until the discrepancy is fixed. - check_index=not (PANDAS_GT_200 and expected.index.empty), + check_index=not (PANDAS_GE_200 and expected.index.empty), ) # hash join