Skip to content

Commit

Permalink
Fix compatibility variable naming (#8030)
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait authored Jul 24, 2023
1 parent 472df84 commit efc7eeb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions distributed/protocol/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
):
Expand Down
4 changes: 2 additions & 2 deletions distributed/protocol/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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():
Expand Down
10 changes: 5 additions & 5 deletions distributed/shuffle/tests/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit efc7eeb

Please sign in to comment.