Skip to content

Commit 66559a0

Browse files
authored
chore: Remove unused utility functions (#2677)
chore: Remove dead code
1 parent 8327684 commit 66559a0

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

narwhals/_utils.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -640,18 +640,6 @@ def _import_native_namespace(module_name: str) -> ModuleType:
640640
return import_module(module_name)
641641

642642

643-
def remove_prefix(text: str, prefix: str) -> str: # pragma: no cover
644-
if text.startswith(prefix):
645-
return text[len(prefix) :]
646-
return text
647-
648-
649-
def remove_suffix(text: str, suffix: str) -> str: # pragma: no cover
650-
if text.endswith(suffix):
651-
return text[: -len(suffix)]
652-
return text # pragma: no cover
653-
654-
655643
def flatten(args: Any) -> list[Any]:
656644
return list(args[0] if (len(args) == 1 and _is_iterable(args[0])) else args)
657645

utils/check_api_reference.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import polars as pl
1111

1212
import narwhals as nw
13-
from narwhals._utils import remove_prefix
1413

1514
LOWERCASE = tuple(string.ascii_lowercase)
1615

@@ -33,6 +32,12 @@ def iter_api_reference_names(tp: type[Any]) -> Iterator[str]:
3332
yield name
3433

3534

35+
def remove_prefix(text: str, prefix: str) -> str:
36+
if text.startswith(prefix):
37+
return text[len(prefix) :]
38+
return text
39+
40+
3641
ret = 0
3742

3843
NAMESPACES = {"dt", "str", "cat", "name", "list", "struct"}

0 commit comments

Comments
 (0)