Skip to content

Commit 1abc05a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into more-dedup-1
2 parents 0242421 + b362e46 commit 1abc05a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

narwhals/utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
from narwhals.typing import DataFrameLike
6464
from narwhals.typing import DTypes
6565
from narwhals.typing import IntoSeriesT
66-
from narwhals.typing import NativeFrame
6766
from narwhals.typing import SizeUnit
6867
from narwhals.typing import SupportsNativeNamespace
6968
from narwhals.typing import TimeUnit
@@ -108,6 +107,10 @@ class _FullContext(_StoresImplementation, _LimitedContext, Protocol): # noqa: P
108107
- `_version`
109108
"""
110109

110+
class _StoresColumns(Protocol):
111+
@property
112+
def columns(self) -> Sequence[str]: ...
113+
111114

112115
class Version(Enum):
113116
V1 = auto()
@@ -1349,10 +1352,8 @@ def dtype_matches_time_unit_and_time_zone(
13491352
)
13501353

13511354

1352-
def get_column_names(
1353-
df: NativeFrame | CompliantDataFrame[Any] | CompliantLazyFrame,
1354-
) -> Sequence[str]:
1355-
return df.columns
1355+
def get_column_names(frame: _StoresColumns, /) -> Sequence[str]:
1356+
return frame.columns
13561357

13571358

13581359
def _hasattr_static(obj: Any, attr: str) -> bool:

0 commit comments

Comments
 (0)