Skip to content

CLN: Remove unused functions/variables #43753

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 7 commits into from
Sep 28, 2021
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
1 change: 0 additions & 1 deletion pandas/_libs/hashtable.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import (
Any,
Hashable,
Literal,
)
Expand Down
10 changes: 5 additions & 5 deletions pandas/io/clipboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def copy_osx_pbcopy(text):

def paste_osx_pbcopy():
p = subprocess.Popen(["pbpaste", "r"], stdout=subprocess.PIPE, close_fds=True)
stdout, stderr = p.communicate()
stdout = p.communicate()[0]
return stdout.decode(ENCODING)

return copy_osx_pbcopy, paste_osx_pbcopy
Expand Down Expand Up @@ -194,7 +194,7 @@ def paste_xclip(primary=False):
stderr=subprocess.PIPE,
close_fds=True,
)
stdout, stderr = p.communicate()
stdout = p.communicate()[0]
# Intentionally ignore extraneous output on stderr when clipboard is empty
return stdout.decode(ENCODING)

Expand Down Expand Up @@ -222,7 +222,7 @@ def paste_xsel(primary=False):
p = subprocess.Popen(
["xsel", selection_flag, "-o"], stdout=subprocess.PIPE, close_fds=True
)
stdout, stderr = p.communicate()
stdout = p.communicate()[0]
return stdout.decode(ENCODING)

return copy_xsel, paste_xsel
Expand Down Expand Up @@ -250,7 +250,7 @@ def paste_klipper():
stdout=subprocess.PIPE,
close_fds=True,
)
stdout, stderr = p.communicate()
stdout = p.communicate()[0]

# Workaround for https://bugs.kde.org/show_bug.cgi?id=342874
# TODO: https://github.com/asweigart/pyperclip/issues/43
Expand Down Expand Up @@ -493,7 +493,7 @@ def paste_wsl():
stderr=subprocess.PIPE,
close_fds=True,
)
stdout, stderr = p.communicate()
stdout = p.communicate()[0]
# WSL appends "\r\n" to the contents.
return stdout[:-2].decode(ENCODING)

Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def space_format(x, y):
need_leadsp = dict(zip(fmt_columns, map(is_numeric_dtype, dtypes)))
str_columns = [
[" " + x if not self._get_formatter(i) and need_leadsp[x] else x]
for i, (col, x) in enumerate(zip(columns, fmt_columns))
for i, x in enumerate(fmt_columns)
]
# self.str_columns = str_columns
return str_columns
Expand Down
2 changes: 0 additions & 2 deletions pandas/io/formats/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ def build_elems(self) -> None:
def write_output(self) -> str | None:
xml_doc = self.build_tree()

out_str: str | None

if self.path_or_buffer is not None:
with get_handle(
self.path_or_buffer,
Expand Down
1 change: 0 additions & 1 deletion pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ def _build_xpath_expr(attrs) -> str:


_re_namespace = {"re": "http://exslt.org/regular-expressions"}
_valid_schemes = "http", "file", "ftp"


class _LxmlFrameParser(_HtmlFrameParser):
Expand Down
8 changes: 2 additions & 6 deletions pandas/io/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ def _parse_nodes(self) -> list[dict[str, str | None]]:
dicts = [{k: d[k] if k in d.keys() else None for k in keys} for d in dicts]

if self.names:
dicts = [
{nm: v for nm, (k, v) in zip(self.names, d.items())} for d in dicts
]
dicts = [{nm: v for nm, v in zip(self.names, d.values())} for d in dicts]

return dicts

Expand Down Expand Up @@ -478,9 +476,7 @@ def _parse_nodes(self) -> list[dict[str, str | None]]:
dicts = [{k: d[k] if k in d.keys() else None for k in keys} for d in dicts]

if self.names:
dicts = [
{nm: v for nm, (k, v) in zip(self.names, d.items())} for d in dicts
]
dicts = [{nm: v for nm, v in zip(self.names, d.values())} for d in dicts]

return dicts

Expand Down
107 changes: 0 additions & 107 deletions pandas/util/_depr_module.py

This file was deleted.