4444T = TypeVar ("T" )
4545
4646
47- class CompliantDataFrame (Sized , Protocol [CompliantSeriesT , CompliantExprT_contra ]):
47+ class CompliantDataFrame (
48+ _StoresNative [NativeFrameT_co ],
49+ Sized ,
50+ Protocol [CompliantSeriesT , CompliantExprT_contra , NativeFrameT_co ],
51+ ):
52+ _native_frame : Any
53+
4854 def __narwhals_dataframe__ (self ) -> Self : ...
4955 def __narwhals_namespace__ (self ) -> Any : ...
5056 def __array__ (self , dtype : Any , * , copy : bool | None ) -> _2DArray : ...
@@ -60,6 +66,10 @@ def aggregate(self, *exprs: CompliantExprT_contra) -> Self:
6066 """
6167 return self .select (* exprs )
6268
69+ @property
70+ def native (self ) -> NativeFrameT_co :
71+ return self ._native_frame # type: ignore[no-any-return]
72+
6373 @property
6474 def columns (self ) -> Sequence [str ]: ...
6575 @property
@@ -69,7 +79,7 @@ def shape(self) -> tuple[int, int]: ...
6979 def clone (self ) -> Self : ...
7080 def collect (
7181 self , backend : Implementation | None , ** kwargs : Any
72- ) -> CompliantDataFrame [Any , Any ]: ...
82+ ) -> CompliantDataFrame [Any , Any , Any ]: ...
7383 def collect_schema (self ) -> Mapping [str , DType ]: ...
7484 def drop (self , columns : Sequence [str ], * , strict : bool ) -> Self : ...
7585 def drop_nulls (self , subset : Sequence [str ] | None ) -> Self : ...
@@ -195,7 +205,7 @@ def schema(self) -> Mapping[str, DType]: ...
195205 def _iter_columns (self ) -> Iterator [Any ]: ...
196206 def collect (
197207 self , backend : Implementation | None , ** kwargs : Any
198- ) -> CompliantDataFrame [Any , Any ]: ...
208+ ) -> CompliantDataFrame [Any , Any , Any ]: ...
199209 def collect_schema (self ) -> Mapping [str , DType ]: ...
200210 def drop (self , columns : Sequence [str ], * , strict : bool ) -> Self : ...
201211 def drop_nulls (self , subset : Sequence [str ] | None ) -> Self : ...
@@ -252,7 +262,7 @@ def with_row_index(self, name: str) -> Self: ...
252262
253263
254264class EagerDataFrame (
255- CompliantDataFrame [EagerSeriesT , EagerExprT_contra ],
265+ CompliantDataFrame [EagerSeriesT , EagerExprT_contra , NativeFrameT_co ],
256266 CompliantLazyFrame [EagerExprT_contra , NativeFrameT_co ],
257267 Protocol [EagerSeriesT , EagerExprT_contra , NativeFrameT_co ],
258268):
0 commit comments