The following issues were found

pandas/_libs/__init__.py
3 issues
Unable to import 'pandas._libs.interval'
Error

Line: 13 Column: 1

              ]


from pandas._libs.interval import Interval
from pandas._libs.tslibs import (
    NaT,
    NaTType,
    OutOfBoundsDatetime,
    Period,

            

Reported by Pylint.

No name 'interval' in module 'pandas._libs'
Error

Line: 13 Column: 1

              ]


from pandas._libs.interval import Interval
from pandas._libs.tslibs import (
    NaT,
    NaTType,
    OutOfBoundsDatetime,
    Period,

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              __all__ = [
    "NaT",
    "NaTType",
    "OutOfBoundsDatetime",
    "Period",
    "Timedelta",
    "Timestamp",
    "iNaT",
    "Interval",

            

Reported by Pylint.

pandas/errors/__init__.py
3 issues
Unnecessary pass statement
Error

Line: 21 Column: 5

                  dtype.
    """

    pass


class NullFrequencyError(ValueError):
    """
    Error raised when a null `freq` attribute is used in an operation

            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 31 Column: 5

                  `TimedeltaIndex.shift`, `PeriodIndex.shift`.
    """

    pass


class PerformanceWarning(Warning):
    """
    Warning raised when there is a possible performance impact.

            

Reported by Pylint.

__init__ method from base class 'NotImplementedError' is not called
Error

Line: 194 Column: 5

                  while keeping compatibility with Python 2 and Python 3.
    """

    def __init__(self, class_instance, methodtype="method"):
        types = {"method", "classmethod", "staticmethod", "property"}
        if methodtype not in types:
            raise ValueError(
                f"methodtype must be one of {methodtype}, got {types} instead."
            )

            

Reported by Pylint.

pandas/_config/display.py
3 issues
Using the global statement
Error

Line: 22 Column: 5

                  Try to find the most capable encoding supported by the console.
    slightly modified from the way IPython handles the same issue.
    """
    global _initial_defencoding

    encoding = None
    try:
        encoding = sys.stdout.encoding or sys.stdin.encoding
    except (AttributeError, OSError):

            

Reported by Pylint.

Constant name "_initial_defencoding" doesn't conform to UPPER_CASE naming style
Error

Line: 22 Column: 5

                  Try to find the most capable encoding supported by the console.
    slightly modified from the way IPython handles the same issue.
    """
    global _initial_defencoding

    encoding = None
    try:
        encoding = sys.stdout.encoding or sys.stdin.encoding
    except (AttributeError, OSError):

            

Reported by Pylint.

Constant name "pc_encoding_doc" doesn't conform to UPPER_CASE naming style
Error

Line: 52 Column: 1

                  return encoding


pc_encoding_doc = """
: str/unicode
    Defaults to the detected encoding of the console.
    Specifies the encoding to be used for strings returned by to_string,
    these are generally strings meant to be displayed on the console.
"""

            

Reported by Pylint.

pandas/io/clipboards.py
3 issues
Import outside toplevel (pandas.io.clipboard.clipboard_get)
Error

Line: 38 Column: 5

                  if encoding is not None and encoding.lower().replace("-", "") != "utf8":
        raise NotImplementedError("reading from clipboard only supports utf-8 encoding")

    from pandas.io.clipboard import clipboard_get
    from pandas.io.parsers import read_csv

    text = clipboard_get()

    # Try to decode (if needed, as "text" might already be a string here).

            

Reported by Pylint.

Import outside toplevel (pandas.io.parsers.read_csv)
Error

Line: 39 Column: 5

                      raise NotImplementedError("reading from clipboard only supports utf-8 encoding")

    from pandas.io.clipboard import clipboard_get
    from pandas.io.parsers import read_csv

    text = clipboard_get()

    # Try to decode (if needed, as "text" might already be a string here).
    try:

            

Reported by Pylint.

Import outside toplevel (pandas.io.clipboard.clipboard_set)
Error

Line: 115 Column: 5

                  if encoding is not None and encoding.lower().replace("-", "") != "utf8":
        raise ValueError("clipboard only supports utf-8 encoding")

    from pandas.io.clipboard import clipboard_set

    if excel is None:
        excel = True

    if excel:

            

Reported by Pylint.

pandas/io/spss.py
3 issues
Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import annotations

from pathlib import Path
from typing import Sequence

from pandas.compat._optional import import_optional_dependency

from pandas.core.dtypes.inference import is_list_like


            

Reported by Pylint.

Unnecessary "else" after "raise"
Error

Line: 41 Column: 9

                  pyreadstat = import_optional_dependency("pyreadstat")

    if usecols is not None:
        if not is_list_like(usecols):
            raise TypeError("usecols must be list-like.")
        else:
            usecols = list(usecols)  # pyreadstat requires a list

    df, _ = pyreadstat.read_sav(

            

Reported by Pylint.

Variable name "df" doesn't conform to snake_case naming style
Error

Line: 46 Column: 5

                      else:
            usecols = list(usecols)  # pyreadstat requires a list

    df, _ = pyreadstat.read_sav(
        stringify_path(path), usecols=usecols, apply_value_formats=convert_categoricals
    )
    return df

            

Reported by Pylint.

pandas/core/internals/api.py
3 issues
Unable to import 'pandas._libs.internals'
Error

Line: 13 Column: 1

              
import numpy as np

from pandas._libs.internals import BlockPlacement
from pandas._typing import Dtype

from pandas.core.dtypes.common import (
    is_datetime64tz_dtype,
    pandas_dtype,

            

Reported by Pylint.

No name 'internals' in module 'pandas._libs'
Error

Line: 13 Column: 1

              
import numpy as np

from pandas._libs.internals import BlockPlacement
from pandas._typing import Dtype

from pandas.core.dtypes.common import (
    is_datetime64tz_dtype,
    pandas_dtype,

            

Reported by Pylint.

Access to a protected member _simple_new of a client class
Error

Line: 59 Column: 18

              
    elif klass is DatetimeTZBlock and not is_datetime64tz_dtype(values.dtype):
        # pyarrow calls get here
        values = DatetimeArray._simple_new(values, dtype=dtype)

    if not isinstance(placement, BlockPlacement):
        placement = BlockPlacement(placement)

    ndim = maybe_infer_ndim(values, placement, ndim)

            

Reported by Pylint.

pandas/io/gbq.py
3 issues
Too many arguments (13/5)
Error

Line: 26 Column: 1

                  return pandas_gbq


def read_gbq(
    query: str,
    project_id: str | None = None,
    index_col: str | None = None,
    col_order: list[str] | None = None,
    reauth: bool = False,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 198 Column: 1

                  )


def to_gbq(
    dataframe: DataFrame,
    destination_table: str,
    project_id: str | None = None,
    chunksize: int | None = None,
    reauth: bool = False,

            

Reported by Pylint.

Too many arguments (11/5)
Error

Line: 198 Column: 1

                  )


def to_gbq(
    dataframe: DataFrame,
    destination_table: str,
    project_id: str | None = None,
    chunksize: int | None = None,
    reauth: bool = False,

            

Reported by Pylint.

pandas/tests/series/methods/test_reindex_like.py
3 issues
Missing module docstring
Error

Line: 1 Column: 1

              from datetime import datetime

import numpy as np

from pandas import Series
import pandas._testing as tm


def test_reindex_like(datetime_series):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 9 Column: 1

              import pandas._testing as tm


def test_reindex_like(datetime_series):
    other = datetime_series[::2]
    tm.assert_series_equal(
        datetime_series.reindex(other.index), datetime_series.reindex_like(other)
    )


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 1

                  tm.assert_series_equal(result, expected)


def test_reindex_like_nearest():
    ser = Series(np.arange(10, dtype="int64"))

    target = [0.1, 0.9, 1.5, 2.0]
    other = ser.reindex(target, method="nearest")
    expected = Series(np.around(target).astype("int64"), target)

            

Reported by Pylint.

pandas/tests/util/test_numba.py
3 issues
Unable to import 'pytest'
Error

Line: 1 Column: 1

              import pytest

import pandas.util._test_decorators as td

from pandas import option_context


@td.skip_if_installed("numba")
def test_numba_not_installed_option_context():

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import pytest

import pandas.util._test_decorators as td

from pandas import option_context


@td.skip_if_installed("numba")
def test_numba_not_installed_option_context():

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 9 Column: 1

              

@td.skip_if_installed("numba")
def test_numba_not_installed_option_context():
    with pytest.raises(ImportError, match="Missing optional"):
        with option_context("compute.use_numba", True):
            pass

            

Reported by Pylint.

pandas/util/__init__.py
3 issues
Missing module docstring
Error

Line: 1 Column: 1

              from pandas.util._decorators import (  # noqa
    Appender,
    Substitution,
    cache_readonly,
)

from pandas.core.util.hashing import (  # noqa
    hash_array,
    hash_pandas_object,

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 14 Column: 5

              

def __getattr__(name):
    if name == "testing":
        import pandas.util.testing

        return pandas.util.testing
    else:
        raise AttributeError(f"module 'pandas.util' has no attribute '{name}'")

            

Reported by Pylint.

Import outside toplevel (pandas.util.testing)
Error

Line: 15 Column: 9

              
def __getattr__(name):
    if name == "testing":
        import pandas.util.testing

        return pandas.util.testing
    else:
        raise AttributeError(f"module 'pandas.util' has no attribute '{name}'")

            

Reported by Pylint.