Skip to content
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.284
rev: v0.0.285
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def is_bool_indexer(key: Any) -> bool:
elif isinstance(key, list):
# check if np.array(key).dtype would be bool
if len(key) > 0:
if type(key) is not list:
if type(key) is not list: # noqa: E721
# GH#42461 cython will raise TypeError if we pass a subclass
key = list(key)
return lib.is_bool_list(key)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7528,7 +7528,7 @@ def ensure_index(index_like: Axes, copy: bool = False) -> Index:
index_like = list(index_like)

if isinstance(index_like, list):
if type(index_like) is not list:
if type(index_like) is not list: # noqa: E721
# must check for exactly list here because of strict type
# check in clean_index_list
index_like = list(index_like)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def _list_of_dict_to_arrays(

# assure that they are of the base dict class and not of derived
# classes
data = [d if type(d) is dict else dict(d) for d in data]
data = [d if type(d) is dict else dict(d) for d in data] # noqa: E721
Copy link
Member

@twoertwein twoertwein Aug 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of ignoring the issue, maybe try [d if isinstance(d, dict) ...]?

edit: The comment suggests that it needs to be a dict and not a subclass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twoertwein yes, sir. So, I guess there is nothing I need to change?


content = lib.dicts_to_array(data, list(columns))
return content, columns
Expand Down