Skip to content

Commit e727a56

Browse files
authored
CLN: Remove unused functions/variables (#43753)
1 parent 010ea17 commit e727a56

File tree

7 files changed

+8
-123
lines changed

7 files changed

+8
-123
lines changed

pandas/_libs/hashtable.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from typing import (
2-
Any,
32
Hashable,
43
Literal,
54
)

pandas/io/clipboard/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def copy_osx_pbcopy(text):
116116

117117
def paste_osx_pbcopy():
118118
p = subprocess.Popen(["pbpaste", "r"], stdout=subprocess.PIPE, close_fds=True)
119-
stdout, stderr = p.communicate()
119+
stdout = p.communicate()[0]
120120
return stdout.decode(ENCODING)
121121

122122
return copy_osx_pbcopy, paste_osx_pbcopy
@@ -194,7 +194,7 @@ def paste_xclip(primary=False):
194194
stderr=subprocess.PIPE,
195195
close_fds=True,
196196
)
197-
stdout, stderr = p.communicate()
197+
stdout = p.communicate()[0]
198198
# Intentionally ignore extraneous output on stderr when clipboard is empty
199199
return stdout.decode(ENCODING)
200200

@@ -222,7 +222,7 @@ def paste_xsel(primary=False):
222222
p = subprocess.Popen(
223223
["xsel", selection_flag, "-o"], stdout=subprocess.PIPE, close_fds=True
224224
)
225-
stdout, stderr = p.communicate()
225+
stdout = p.communicate()[0]
226226
return stdout.decode(ENCODING)
227227

228228
return copy_xsel, paste_xsel
@@ -250,7 +250,7 @@ def paste_klipper():
250250
stdout=subprocess.PIPE,
251251
close_fds=True,
252252
)
253-
stdout, stderr = p.communicate()
253+
stdout = p.communicate()[0]
254254

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

pandas/io/formats/format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ def space_format(x, y):
876876
need_leadsp = dict(zip(fmt_columns, map(is_numeric_dtype, dtypes)))
877877
str_columns = [
878878
[" " + x if not self._get_formatter(i) and need_leadsp[x] else x]
879-
for i, (col, x) in enumerate(zip(columns, fmt_columns))
879+
for i, x in enumerate(fmt_columns)
880880
]
881881
# self.str_columns = str_columns
882882
return str_columns

pandas/io/formats/xml.py

-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ def build_elems(self) -> None:
264264
def write_output(self) -> str | None:
265265
xml_doc = self.build_tree()
266266

267-
out_str: str | None
268-
269267
if self.path_or_buffer is not None:
270268
with get_handle(
271269
self.path_or_buffer,

pandas/io/html.py

-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ def _build_xpath_expr(attrs) -> str:
632632

633633

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

637636

638637
class _LxmlFrameParser(_HtmlFrameParser):

pandas/io/xml.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,7 @@ def _parse_nodes(self) -> list[dict[str, str | None]]:
297297
dicts = [{k: d[k] if k in d.keys() else None for k in keys} for d in dicts]
298298

299299
if self.names:
300-
dicts = [
301-
{nm: v for nm, (k, v) in zip(self.names, d.items())} for d in dicts
302-
]
300+
dicts = [{nm: v for nm, v in zip(self.names, d.values())} for d in dicts]
303301

304302
return dicts
305303

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

480478
if self.names:
481-
dicts = [
482-
{nm: v for nm, (k, v) in zip(self.names, d.items())} for d in dicts
483-
]
479+
dicts = [{nm: v for nm, v in zip(self.names, d.values())} for d in dicts]
484480

485481
return dicts
486482

pandas/util/_depr_module.py

-107
This file was deleted.

0 commit comments

Comments
 (0)