Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fast_slow_proxy: Don't import assert_eq at top-level #16063

Merged
merged 8 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move imports of assert_eq in test files
  • Loading branch information
wence- committed Jun 24, 2024
commit cc2fbf7ca5b7bfe4dcbd279a5d38589feb41c261
4 changes: 2 additions & 2 deletions python/cudf/cudf/_fuzz_testing/tests/fuzz_test_csv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

import sys
from io import StringIO
Expand All @@ -13,7 +13,7 @@
compare_content,
run_test,
)
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pythonfuzz(data_handle=CSVReader)
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/_fuzz_testing/tests/fuzz_test_json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

import io
import sys
Expand All @@ -9,7 +9,7 @@
from cudf._fuzz_testing.json import JSONReader, JSONWriter
from cudf._fuzz_testing.main import pythonfuzz
from cudf._fuzz_testing.utils import ALL_POSSIBLE_VALUES, run_test
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pythonfuzz(data_handle=JSONReader)
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/_fuzz_testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pyarrow as pa

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq
from cudf.utils.dtypes import (
pandas_dtypes_to_np_dtypes,
pyarrow_dtypes_to_pandas_dtypes,
Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/testing/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from cudf.core.column.timedelta import _unit_to_nanoseconds_conversion
from cudf.core.udf.strings_lowering import cast_string_view_to_udf_string
from cudf.core.udf.strings_typing import StringView, string_view, udf_string
from cudf.testing.testing import assert_eq, assert_neq # noqa: F401
from cudf.utils import dtypes as dtypeutils

supported_numpy_dtypes = [
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.

import itertools
import os
Expand All @@ -11,7 +11,7 @@
import rmm # noqa: F401

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq

_CURRENT_DIRECTORY = str(pathlib.Path(__file__).resolve().parent)

Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/dataframe/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
import pandas as pd
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_convert_dtypes():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/groupby/test_computation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
import pandas as pd
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.mark.parametrize("method", ["average", "min", "max", "first", "dense"])
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/groupby/test_groupby_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from numpy.testing import assert_array_equal

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_groupby_14955():
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/groupby/test_indexing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_rank_return_type_compatible_mode():
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/groupby/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.fixture(params=[False, True], ids=["no-null-keys", "null-keys"])
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/indexes/datetime/test_indexing.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

import pandas as pd

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_slice_datetimetz_index():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas as pd

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_tz_localize():
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/indexes/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cudf
from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION
from cudf.core.index import IntervalIndex, interval_range
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def test_interval_constructor_default_closed():
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/input_output/test_text.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.

from io import StringIO

import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.fixture(scope="module")
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/series/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
import pandas as pd
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/series/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import cudf
from cudf import date_range
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


def _get_all_zones():
Expand Down
5 changes: 3 additions & 2 deletions python/cudf/cudf/tests/test_apply_rows.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Copyright (c) 2019-2024, NVIDIA CORPORATION.

import pytest

import cudf
from cudf.core.column import column
from cudf.testing._utils import assert_eq, gen_rand_series
from cudf.testing import assert_eq
from cudf.testing._utils import gen_rand_series


def _kernel_multiply(a, b, out):
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_applymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from cudf import NA, DataFrame
from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION
from cudf.testing import _utils as utils
from cudf.testing import assert_eq


@pytest.mark.skipif(
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_applymap_dataframe(data, func, na_action, request):
with pytest.warns(FutureWarning):
got = gdf.applymap(func, na_action=na_action)

utils.assert_eq(expect, got, check_dtype=False)
assert_eq(expect, got, check_dtype=False)


def test_applymap_raise_cases():
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_array_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


# To determine if NEP18 is available in the current version of NumPy we simply
Expand Down
7 changes: 2 additions & 5 deletions python/cudf/cudf/tests/test_array_ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
PANDAS_LT_300,
PANDAS_VERSION,
)
from cudf.testing._utils import (
assert_eq,
expect_warning_if,
set_random_null_mask_inplace,
)
from cudf.testing import assert_eq
from cudf.testing._utils import expect_warning_if, set_random_null_mask_inplace

_UFUNCS = [
obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq
from cudf.testing.dataset_generator import rand_dataframe


Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_binops.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from cudf import Index, Series
from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION
from cudf.core.buffer.spill_manager import get_global_manager
from cudf.testing import _utils as utils
from cudf.testing import _utils as utils, assert_eq
from cudf.utils.dtypes import (
BOOL_TYPES,
DATETIME_TYPES,
Expand Down Expand Up @@ -194,7 +194,7 @@ def test_series_binop(binop, obj_class):
if obj_class == "Index":
result = Series(result)

utils.assert_eq(result, expect)
assert_eq(result, expect)


@pytest.mark.parametrize("binop", _binops)
Expand Down
7 changes: 2 additions & 5 deletions python/cudf/cudf/tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
import pytest

import cudf
from cudf.testing._utils import (
NUMERIC_TYPES,
assert_eq,
assert_exceptions_equal,
)
from cudf.testing import assert_eq
from cudf.testing._utils import NUMERIC_TYPES, assert_exceptions_equal


@contextmanager
Expand Down
3 changes: 2 additions & 1 deletion python/cudf/cudf/tests/test_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import cudf
from cudf._lib.transform import mask_to_bools
from cudf.core.column.column import as_column
from cudf.testing._utils import assert_eq, assert_exceptions_equal
from cudf.testing import assert_eq
from cudf.testing._utils import assert_exceptions_equal
from cudf.utils import dtypes as dtypeutils

dtypes = sorted(
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_column_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import cudf
from cudf.core.column_accessor import ColumnAccessor
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq

simple_test_data = [
{},
Expand Down
7 changes: 2 additions & 5 deletions python/cudf/cudf/tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@

import cudf
from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
from cudf.testing._utils import (
assert_eq,
assert_exceptions_equal,
expect_warning_if,
)
from cudf.testing import assert_eq
from cudf.testing._utils import assert_exceptions_equal, expect_warning_if


@contextmanager
Expand Down
8 changes: 2 additions & 6 deletions python/cudf/cudf/tests/test_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
import cudf
from cudf import Series
from cudf.core.index import Index, RangeIndex
from cudf.testing._utils import (
DATETIME_TYPES,
NUMERIC_TYPES,
TIMEDELTA_TYPES,
assert_eq,
)
from cudf.testing import assert_eq
from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, TIMEDELTA_TYPES


def cudf_date_series(start, stop, freq):
Expand Down
3 changes: 2 additions & 1 deletion python/cudf/cudf/tests/test_copying.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import cudf
from cudf import Series
from cudf.core.buffer.spill_manager import get_global_manager
from cudf.testing._utils import NUMERIC_TYPES, OTHER_TYPES, assert_eq
from cudf.testing import assert_eq
from cudf.testing._utils import NUMERIC_TYPES, OTHER_TYPES

pytestmark = pytest.mark.spilling

Expand Down
3 changes: 2 additions & 1 deletion python/cudf/cudf/tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import cudf
from cudf import read_csv
from cudf.core._compat import PANDAS_CURRENT_SUPPORTED_VERSION, PANDAS_VERSION
from cudf.testing._utils import assert_eq, assert_exceptions_equal
from cudf.testing import assert_eq
from cudf.testing._utils import assert_exceptions_equal


def make_numeric_dataframe(nrows, dtype):
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_cuda_apply.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2022, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.

"""
Test method that apply GPU kernel to a frame.
Expand All @@ -9,7 +9,7 @@
from numba import cuda

from cudf import DataFrame
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.mark.parametrize("nelem", [1, 2, 64, 128, 129])
Expand Down
8 changes: 2 additions & 6 deletions python/cudf/cudf/tests/test_cuda_array_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@

import cudf
from cudf.core.buffer.spill_manager import get_global_manager
from cudf.testing._utils import (
DATETIME_TYPES,
NUMERIC_TYPES,
TIMEDELTA_TYPES,
assert_eq,
)
from cudf.testing import assert_eq
from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, TIMEDELTA_TYPES


@pytest.mark.parametrize("dtype", NUMERIC_TYPES + DATETIME_TYPES)
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_custom_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

import cudf
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@cudf.api.extensions.register_dataframe_accessor("point")
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

from cudf.core.cut import cut
from cudf.testing._utils import assert_eq
from cudf.testing import assert_eq


@pytest.mark.parametrize(
Expand Down
Loading
Loading