Skip to content

CLN: some simple code cleanup #47438

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 2 commits into from
Aug 3, 2022
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/io/formats/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
unique_declarations = frozenset(declaration_dict.items())
style = css_converter(unique_declarations)

return super().__init__(row=row, col=col, val=val, style=style, **kwargs)
super().__init__(row=row, col=col, val=val, style=style, **kwargs)


class CSSToExcelConverter:
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/apply/test_series_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def test_map_abc_mapping_with_missing(non_dict_mapping_subclass):
# https://github.com/pandas-dev/pandas/issues/29733
# Check collections.abc.Mapping support as mapper for Series.map
class NonDictMappingWithMissing(non_dict_mapping_subclass):
def __missing__(key):
Copy link
Member

Choose a reason for hiding this comment

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

this looks like it should fail in the status quo. does this change fix anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay, @jbrockmendel ! In this case, for example, it doesn't fail because missing is not directly called. Essentially these changes don't fix anything but code readability and correctness.

def __missing__(self, key):
return "missing"

s = Series([1, 2, 3])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/dtypes/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def test_is_sequence():
assert not is_seq(np.int64)

class A:
def __getitem__(self):
def __getitem__(self, item):
return 1

assert not is_seq(A())
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ def __init__(self, lst) -> None:
def __getitem__(self, n):
return self._lst.__getitem__(n)

def __len__(self, n):
def __len__(self):
return self._lst.__len__()

lst_containers = [DummyContainer([1, "a"]), DummyContainer([2, "b"])]
Expand Down