Skip to content

CLN remove unnecessary noqas from pandas/core #36684

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

Merged
merged 1 commit into from
Sep 27, 2020
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
2 changes: 1 addition & 1 deletion pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from pandas.core.indexers import validate_indices

if TYPE_CHECKING:
from pandas import Categorical, DataFrame, Series # noqa:F401
from pandas import Categorical, DataFrame, Series

_shared_docs: Dict[str, str] = {}

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from .masked import BaseMaskedArray, BaseMaskedDtype

if TYPE_CHECKING:
import pyarrow # noqa: F401
import pyarrow


@register_extension_dtype
Expand Down Expand Up @@ -98,7 +98,7 @@ def __from_arrow__(
"""
Construct BooleanArray from pyarrow Array/ChunkedArray.
"""
import pyarrow # noqa: F811
import pyarrow

if isinstance(array, pyarrow.Array):
chunks = [array]
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .masked import BaseMaskedArray, BaseMaskedDtype

if TYPE_CHECKING:
import pyarrow # noqa: F401
import pyarrow


class _IntegerDtype(BaseMaskedDtype):
Expand Down Expand Up @@ -115,7 +115,7 @@ def __from_arrow__(
"""
Construct IntegerArray from pyarrow Array/ChunkedArray.
"""
import pyarrow # noqa: F811
import pyarrow

from pandas.core.arrays._arrow_utils import pyarrow_array_to_numpy_and_mask

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/sparse/dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pandas.core.dtypes.missing import isna, na_value_for_dtype

if TYPE_CHECKING:
from pandas.core.arrays.sparse.array import SparseArray # noqa: F401
from pandas.core.arrays.sparse.array import SparseArray


@register_extension_dtype
Expand Down Expand Up @@ -180,7 +180,7 @@ def construct_array_type(cls) -> Type["SparseArray"]:
-------
type
"""
from pandas.core.arrays.sparse.array import SparseArray # noqa: F811
from pandas.core.arrays.sparse.array import SparseArray

return SparseArray

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pandas.core.missing import isna

if TYPE_CHECKING:
import pyarrow # noqa: F401
import pyarrow


@register_extension_dtype
Expand Down Expand Up @@ -79,7 +79,7 @@ def __from_arrow__(
"""
Construct StringArray from pyarrow Array/ChunkedArray.
"""
import pyarrow # noqa: F811
import pyarrow

if isinstance(array, pyarrow.Array):
chunks = [array]
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries

if TYPE_CHECKING:
from pandas.core.arrays import ExtensionArray # noqa: F401
from pandas.core.arrays import ExtensionArray


class ExtensionDtype:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

if TYPE_CHECKING:
from pandas import Series
from pandas.core.arrays import ExtensionArray # noqa: F401
from pandas.core.arrays import ExtensionArray

_int8_max = np.iinfo(np.int8).max
_int16_max = np.iinfo(np.int16).max
Expand Down
18 changes: 7 additions & 11 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@
from pandas.core.dtypes.inference import is_bool, is_list_like

if TYPE_CHECKING:
import pyarrow # noqa: F401
import pyarrow

from pandas import Categorical # noqa: F401
from pandas.core.arrays import ( # noqa: F401
DatetimeArray,
IntervalArray,
PeriodArray,
)
from pandas import Categorical
from pandas.core.arrays import DatetimeArray, IntervalArray, PeriodArray

str_type = str

Expand Down Expand Up @@ -457,7 +453,7 @@ def construct_array_type(cls) -> Type["Categorical"]:
-------
type
"""
from pandas import Categorical # noqa: F811
from pandas import Categorical

return Categorical

Expand Down Expand Up @@ -706,7 +702,7 @@ def construct_array_type(cls) -> Type["DatetimeArray"]:
-------
type
"""
from pandas.core.arrays import DatetimeArray # noqa: F811
from pandas.core.arrays import DatetimeArray

return DatetimeArray

Expand Down Expand Up @@ -959,7 +955,7 @@ def __from_arrow__(
"""
Construct PeriodArray from pyarrow Array/ChunkedArray.
"""
import pyarrow # noqa: F811
import pyarrow

from pandas.core.arrays import PeriodArray
from pandas.core.arrays._arrow_utils import pyarrow_array_to_numpy_and_mask
Expand Down Expand Up @@ -1157,7 +1153,7 @@ def __from_arrow__(
"""
Construct IntervalArray from pyarrow Array/ChunkedArray.
"""
import pyarrow # noqa: F811
import pyarrow

from pandas.core.arrays import IntervalArray

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
from pandas.plotting import boxplot_frame_groupby

if TYPE_CHECKING:
from pandas.core.internals import Block # noqa:F401
from pandas.core.internals import Block


NamedAgg = namedtuple("NamedAgg", ["column", "aggfunc"])
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pandas.core.indexes.timedeltas import TimedeltaIndex

if TYPE_CHECKING:
from pandas import Series # noqa:F401
from pandas import Series


class Properties(PandasDelegate, PandasObject, NoNewAttributesMixin):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from pandas.core.ops import get_op_result_name

if TYPE_CHECKING:
from pandas import CategoricalIndex # noqa:F401
from pandas import CategoricalIndex

_index_doc_kwargs = dict(ibase._index_doc_kwargs)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
)

if TYPE_CHECKING:
from pandas import Series # noqa:F401
from pandas import Series

_index_doc_kwargs = dict(ibase._index_doc_kwargs)
_index_doc_kwargs.update(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from pandas.core.indexes.api import Index

if TYPE_CHECKING:
from pandas import DataFrame, Series # noqa:F401
from pandas import DataFrame, Series

# "null slice"
_NS = slice(None, None)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
)

if TYPE_CHECKING:
from pandas import Series # noqa:F401
from pandas import Series

# ---------------------------------------------------------------------
# BlockManager Interface
Expand Down Expand Up @@ -244,7 +244,7 @@ def init_dict(data: Dict, index, columns, dtype: Optional[DtypeObj] = None):
arrays: Union[Sequence[Any], "Series"]

if columns is not None:
from pandas.core.series import Series # noqa:F811
from pandas.core.series import Series

arrays = Series(data, index=columns, dtype=object)
data_names = arrays.index
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/internals/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from pandas._typing import ArrayLike

if TYPE_CHECKING:
from pandas.core.internals.blocks import Block # noqa:F401
from pandas.core.internals.managers import BlockManager # noqa:F401
from pandas.core.internals.blocks import Block
from pandas.core.internals.managers import BlockManager


BlockPairInfo = namedtuple(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
)

if TYPE_CHECKING:
from pandas import DataFrame, Series # noqa:F401
from pandas import DataFrame, Series

# -----------------------------------------------------------------------------
# constants
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pandas.core.tools.numeric import to_numeric

if TYPE_CHECKING:
from pandas import DataFrame, Series # noqa: F401
from pandas import DataFrame, Series


@Appender(_shared_docs["melt"] % dict(caller="pd.melt(df, ", other="DataFrame.melt"))
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from pandas.core.sorting import is_int64_overflow_possible

if TYPE_CHECKING:
from pandas import DataFrame # noqa:F401
from pandas import DataFrame


@Substitution("\nleft : DataFrame")
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def ensure_key_mapped(values, key: Optional[Callable], levels=None):
levels : Optional[List], if values is a MultiIndex, list of levels to
apply the key to.
"""
from pandas.core.indexes.api import Index # noqa:F811
from pandas.core.indexes.api import Index

if not key:
return values
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/tools/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
from pandas.core.indexes.datetimes import DatetimeIndex

if TYPE_CHECKING:
from pandas._libs.tslibs.nattype import NaTType # noqa:F401
from pandas._libs.tslibs.nattype import NaTType

from pandas import Series # noqa:F401
from pandas import Series

# ---------------------------------------------------------------------
# types used in annotations
Expand Down