Skip to content

Commit

Permalink
Use str.captialize instead of helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Jan 26, 2024
1 parent 9008ee5 commit 9a5ffd2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
is_list_like,
)

from pandas.util import capitalize_first_letter

if not pa_version_under10p1:
import pyarrow as pa

Expand Down Expand Up @@ -1087,7 +1085,7 @@ def na_value(self) -> NaTType:

def __eq__(self, other: object) -> bool:
if isinstance(other, str):
return other in [self.name, capitalize_first_letter(self.name)]
return other in {self.name, self.name.capitalize()}

return super().__eq__(other)

Expand Down
4 changes: 0 additions & 4 deletions pandas/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ def __getattr__(key: str):
return cache_readonly

raise AttributeError(f"module 'pandas.util' has no attribute '{key}'")


def capitalize_first_letter(s: str) -> str:
return s[:1].upper() + s[1:]

0 comments on commit 9a5ffd2

Please sign in to comment.