The following issues were found
pandas/api/extensions/__init__.py
2 issues
Line: 5
Column: 1
Public API for extending pandas objects.
"""
from pandas._libs.lib import no_default
from pandas.core.dtypes.base import (
ExtensionDtype,
register_extension_dtype,
)
Reported by Pylint.
Line: 5
Column: 1
Public API for extending pandas objects.
"""
from pandas._libs.lib import no_default
from pandas.core.dtypes.base import (
ExtensionDtype,
register_extension_dtype,
)
Reported by Pylint.
pandas/_testing/compat.py
2 issues
Line: 8
Column: 1
from pandas import DataFrame
def get_dtype(obj):
if isinstance(obj, DataFrame):
# Note: we are assuming only one column
return obj.dtypes.iat[0]
else:
return obj.dtype
Reported by Pylint.
Line: 9
Column: 5
def get_dtype(obj):
if isinstance(obj, DataFrame):
# Note: we are assuming only one column
return obj.dtypes.iat[0]
else:
return obj.dtype
Reported by Pylint.
pandas/tests/indexes/conftest.py
2 issues
Line: 1
Column: 1
import pytest
@pytest.fixture(params=[None, False])
def sort(request):
"""
Valid values for the 'sort' parameter used in the Index
setops methods (intersection, union, etc.)
Reported by Pylint.
Line: 1
Column: 1
import pytest
@pytest.fixture(params=[None, False])
def sort(request):
"""
Valid values for the 'sort' parameter used in the Index
setops methods (intersection, union, etc.)
Reported by Pylint.
pandas/tests/apply/common.py
1 issues
Line: 1
Column: 1
from pandas.core.groupby.base import transformation_kernels
# tshift only works on time index and is deprecated
# There is no Series.cumcount or DataFrame.cumcount
series_transform_kernels = [
x for x in sorted(transformation_kernels) if x not in ["tshift", "cumcount"]
]
frame_transform_kernels = [
x for x in sorted(transformation_kernels) if x not in ["tshift", "cumcount"]
Reported by Pylint.
pandas/core/arrays/string_.py
1 issues
Line: 334
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
def _from_sequence(cls, scalars, *, dtype: Dtype | None = None, copy=False):
if dtype and not (isinstance(dtype, str) and dtype == "string"):
dtype = pandas_dtype(dtype)
assert isinstance(dtype, StringDtype) and dtype.storage == "python"
from pandas.core.arrays.masked import BaseMaskedArray
if isinstance(scalars, BaseMaskedArray):
# avoid costly conversion to object dtype
Reported by Bandit.
pandas/core/indexers/__init__.py
1 issues
Line: 1
Column: 1
from pandas.core.indexers.utils import (
check_array_indexer,
check_key_length,
check_setitem_lengths,
deprecate_ndim_indexing,
is_empty_indexer,
is_exact_shape_match,
is_list_like_indexer,
is_scalar_indexer,
Reported by Pylint.
pandas/io/excel/__init__.py
1 issues
Line: 1
Column: 1
from pandas.io.excel._base import (
ExcelFile,
ExcelWriter,
read_excel,
)
from pandas.io.excel._odswriter import ODSWriter as _ODSWriter
from pandas.io.excel._openpyxl import OpenpyxlWriter as _OpenpyxlWriter
from pandas.io.excel._util import register_writer
from pandas.io.excel._xlsxwriter import XlsxWriter as _XlsxWriter
Reported by Pylint.
pandas/core/indexes/frozen.py
1 issues
Line: 64
Column: 3
temp = [x for x in self if x not in other]
return type(self)(temp)
# TODO: Consider deprecating these in favor of `union` (xref gh-15506)
__add__ = __iadd__ = union
def __getitem__(self, n):
if isinstance(n, slice):
return type(self)(super().__getitem__(n))
Reported by Pylint.
pandas/tests/extension/json/__init__.py
1 issues
Line: 1
Column: 1
from pandas.tests.extension.json.array import (
JSONArray,
JSONDtype,
make_data,
)
__all__ = ["JSONArray", "JSONDtype", "make_data"]
Reported by Pylint.
pandas/io/parsers/__init__.py
1 issues
Line: 1
Column: 1
from pandas.io.parsers.readers import (
TextFileReader,
TextParser,
read_csv,
read_fwf,
read_table,
)
__all__ = ["TextFileReader", "TextParser", "read_csv", "read_fwf", "read_table"]
Reported by Pylint.