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

[REVIEW] Make cudf.api.types imports consistent #8571

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import cudf
from cudf import _lib as libcudf
from cudf._lib.null_mask import MaskState, create_null_mask
from cudf.api.types import is_bool_dtype, is_dict_like
from cudf.core import column, reshape
from cudf.core.abc import Serializable
from cudf.core.column import as_column, column_empty
Expand Down Expand Up @@ -54,8 +55,6 @@
)
from cudf.utils.utils import GetAttrGetItemMixin

from ..api.types import is_bool_dtype, is_dict_like

T = TypeVar("T", bound="DataFrame")


Expand Down
3 changes: 1 addition & 2 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import cudf
from cudf import _lib as libcudf
from cudf._typing import ColumnLike, DataFrameOrSeries
from cudf.api.types import is_dict_like, is_dtype_equal
from cudf.core.column import (
ColumnBase,
as_column,
Expand All @@ -36,8 +37,6 @@
min_scalar_type,
)

from ..api.types import is_dict_like, is_dtype_equal

T = TypeVar("T", bound="Frame")

if TYPE_CHECKING:
Expand Down
13 changes: 6 additions & 7 deletions python/cudf/cudf/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
from cudf._lib.search import search_sorted
from cudf._lib.table import Table
from cudf._typing import DtypeObj
from cudf.api.types import (
_is_scalar_or_zero_d_array,
is_dtype_equal,
is_integer,
is_string_dtype,
)
from cudf.core.abc import Serializable
from cudf.core.column import (
CategoricalColumn,
Expand Down Expand Up @@ -47,13 +53,6 @@
)
from cudf.utils.utils import cached_property, search_range

from ..api.types import (
_is_scalar_or_zero_d_array,
is_dtype_equal,
is_integer,
is_string_dtype,
)


class BaseIndex(SingleColumnFrame, Serializable):
"""Base class for all cudf Index types."""
Expand Down
13 changes: 6 additions & 7 deletions python/cudf/cudf/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
from cudf._lib.concat import concat_columns
from cudf._lib.scalar import _is_null_host_scalar
from cudf._typing import ColumnLike, DataFrameOrSeries, ScalarLike
from cudf.api.types import (
is_bool_dtype,
is_integer,
is_integer_dtype,
is_numeric_dtype,
)
from cudf.core.column.column import as_column
from cudf.utils.dtypes import (
_is_non_decimal_numeric_dtype,
Expand All @@ -23,13 +29,6 @@
to_cudf_compatible_scalar,
)

from ..api.types import (
is_bool_dtype,
is_integer,
is_integer_dtype,
is_numeric_dtype,
)


def indices_from_labels(obj, labels):
from cudf.core.column import column
Expand Down
3 changes: 1 addition & 2 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import cudf
from cudf import _lib as libcudf
from cudf._lib.transform import bools_to_mask
from cudf.api.types import is_bool_dtype, is_dict_like, is_dtype_equal
from cudf.core.abc import Serializable
from cudf.core.column import (
DatetimeColumn,
Expand Down Expand Up @@ -61,8 +62,6 @@
get_relevant_submodule,
)

from ..api.types import is_bool_dtype, is_dict_like, is_dtype_equal


class Series(SingleColumnFrame, Serializable):
# The `constructor*` properties are used by `dask` (and `dask_cudf`)
Expand Down
5 changes: 2 additions & 3 deletions python/cudf/cudf/utils/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from pandas.core.dtypes.common import infer_dtype_from_object

import cudf
from cudf.core._compat import PANDAS_GE_120

from ..api.types import ( # noqa: F401
from cudf.api.types import ( # noqa: F401
_is_non_decimal_numeric_dtype,
_is_scalar_or_zero_d_array,
is_categorical_dtype,
Expand All @@ -30,6 +28,7 @@
is_struct_dtype,
is_timedelta_dtype,
)
from cudf.core._compat import PANDAS_GE_120

_NA_REP = "<NA>"
_np_pa_dtypes = {
Expand Down