2929 generate_temporary_column_name ,
3030 is_list_of ,
3131 not_implemented ,
32- requires ,
3332)
3433from narwhals .dependencies import is_numpy_array_1d
3534from narwhals .exceptions import InvalidOperationError , ShapeError
@@ -156,7 +155,7 @@ def from_iterable(
156155 )
157156
158157 def _from_scalar (self , value : Any ) -> Self :
159- if self . _backend_version < ( 13 ,) and hasattr (value , "as_py" ):
158+ if hasattr (value , "as_py" ):
160159 value = value .as_py ()
161160 return super ()._from_scalar (value )
162161
@@ -866,7 +865,6 @@ def cum_count(self, *, reverse: bool) -> Self:
866865 dtypes = self ._version .dtypes
867866 return (~ self .is_null ()).cast (dtypes .UInt32 ()).cum_sum (reverse = reverse )
868867
869- @requires .backend_version ((13 ,))
870868 def cum_min (self , * , reverse : bool ) -> Self :
871869 result = (
872870 pc .cumulative_min (self .native , skip_nulls = True )
@@ -875,7 +873,6 @@ def cum_min(self, *, reverse: bool) -> Self:
875873 )
876874 return self ._with_native (result )
877875
878- @requires .backend_version ((13 ,))
879876 def cum_max (self , * , reverse : bool ) -> Self :
880877 result = (
881878 pc .cumulative_max (self .native , skip_nulls = True )
@@ -884,7 +881,6 @@ def cum_max(self, *, reverse: bool) -> Self:
884881 )
885882 return self ._with_native (result )
886883
887- @requires .backend_version ((13 ,))
888884 def cum_prod (self , * , reverse : bool ) -> Self :
889885 result = (
890886 pc .cumulative_prod (self .native , skip_nulls = True )
@@ -1023,7 +1019,6 @@ def rank(self, method: RankMethod, *, descending: bool) -> Self:
10231019 result = pc .if_else (null_mask , lit (None , rank .type ), rank )
10241020 return self ._with_native (result )
10251021
1026- @requires .backend_version ((13 ,))
10271022 def hist ( # noqa: C901, PLR0912, PLR0915
10281023 self ,
10291024 bins : list [float | int ] | None ,
0 commit comments