Skip to content

CLN: Remove private unused code #57842

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
Mar 14, 2024
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
51 changes: 0 additions & 51 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@
TYPE_CHECKING,
Any,
Callable,
Literal,
NamedTuple,
cast,
overload,
)
import warnings

Expand All @@ -69,7 +67,6 @@
if TYPE_CHECKING:
from collections.abc import (
Generator,
Iterable,
Sequence,
)

Expand Down Expand Up @@ -685,54 +682,6 @@ def _build_option_description(k: str) -> str:
return s


@overload
def pp_options_list(
keys: Iterable[str], *, width: int = ..., _print: Literal[False] = ...
) -> str: ...


@overload
def pp_options_list(
keys: Iterable[str], *, width: int = ..., _print: Literal[True]
) -> None: ...


def pp_options_list(
keys: Iterable[str], *, width: int = 80, _print: bool = False
) -> str | None:
"""Builds a concise listing of available options, grouped by prefix"""
from itertools import groupby
from textwrap import wrap

def pp(name: str, ks: Iterable[str]) -> list[str]:
pfx = "- " + name + ".[" if name else ""
ls = wrap(
", ".join(ks),
width,
initial_indent=pfx,
subsequent_indent=" ",
break_long_words=False,
)
if ls and ls[-1] and name:
ls[-1] = ls[-1] + "]"
return ls

ls: list[str] = []
singles = [x for x in sorted(keys) if x.find(".") < 0]
if singles:
ls += pp("", singles)
keys = [x for x in keys if x.find(".") >= 0]

for k, g in groupby(sorted(keys), lambda x: x[: x.rfind(".")]):
ks = [x[len(k) + 1 :] for x in list(g)]
ls += pp(k, ks)
s = "\n".join(ls)
if _print:
print(s)
return s


#
# helpers


Expand Down
1 change: 0 additions & 1 deletion pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def _wrap_result(
expand: bool | None = None,
fill_value=np.nan,
returns_string: bool = True,
returns_bool: bool = False,
dtype=None,
):
from pandas import (
Expand Down
6 changes: 0 additions & 6 deletions pandas/io/parsers/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
Callable,
Generic,
Literal,
NamedTuple,
TypedDict,
overload,
)
Expand Down Expand Up @@ -563,11 +562,6 @@ class _Fwf_Defaults(TypedDict):
}


class _DeprecationConfig(NamedTuple):
default_value: Any
msg: str | None


@overload
def validate_integer(name: str, val: None, min_val: int = ...) -> None: ...

Expand Down
1 change: 0 additions & 1 deletion pandas/io/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def __init__(
self.encoding = encoding
self.stylesheet = stylesheet
self.iterparse = iterparse
self.is_style = None
self.compression: CompressionOptions = compression
self.storage_options = storage_options

Expand Down
Loading