22
33from typing import TYPE_CHECKING
44
5- from narwhals ._expression_parsing import reuse_series_namespace_implementation
6-
75if TYPE_CHECKING :
86 from typing_extensions import Self
97
@@ -16,92 +14,92 @@ def __init__(self: Self, expr: PandasLikeExpr) -> None:
1614 self ._compliant_expr = expr
1715
1816 def date (self : Self ) -> PandasLikeExpr :
19- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "date" )
17+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "date" )
2018
2119 def year (self : Self ) -> PandasLikeExpr :
22- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "year" )
20+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "year" )
2321
2422 def month (self : Self ) -> PandasLikeExpr :
25- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "month" )
23+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "month" )
2624
2725 def day (self : Self ) -> PandasLikeExpr :
28- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "day" )
26+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "day" )
2927
3028 def hour (self : Self ) -> PandasLikeExpr :
31- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "hour" )
29+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "hour" )
3230
3331 def minute (self : Self ) -> PandasLikeExpr :
34- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "minute" )
32+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "minute" )
3533
3634 def second (self : Self ) -> PandasLikeExpr :
37- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "second" )
35+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "second" )
3836
3937 def millisecond (self : Self ) -> PandasLikeExpr :
40- return reuse_series_namespace_implementation (
41- self . _compliant_expr , "dt" , "millisecond"
38+ return self . _compliant_expr . _reuse_series_namespace_implementation (
39+ "dt" , "millisecond"
4240 )
4341
4442 def microsecond (self : Self ) -> PandasLikeExpr :
45- return reuse_series_namespace_implementation (
46- self . _compliant_expr , "dt" , "microsecond"
43+ return self . _compliant_expr . _reuse_series_namespace_implementation (
44+ "dt" , "microsecond"
4745 )
4846
4947 def nanosecond (self : Self ) -> PandasLikeExpr :
50- return reuse_series_namespace_implementation (
51- self . _compliant_expr , "dt" , "nanosecond"
48+ return self . _compliant_expr . _reuse_series_namespace_implementation (
49+ "dt" , "nanosecond"
5250 )
5351
5452 def ordinal_day (self : Self ) -> PandasLikeExpr :
55- return reuse_series_namespace_implementation (
56- self . _compliant_expr , "dt" , "ordinal_day"
53+ return self . _compliant_expr . _reuse_series_namespace_implementation (
54+ "dt" , "ordinal_day"
5755 )
5856
5957 def weekday (self : Self ) -> PandasLikeExpr :
60- return reuse_series_namespace_implementation (
61- self . _compliant_expr , "dt" , "weekday"
58+ return self . _compliant_expr . _reuse_series_namespace_implementation (
59+ "dt" , "weekday"
6260 )
6361
6462 def total_minutes (self : Self ) -> PandasLikeExpr :
65- return reuse_series_namespace_implementation (
66- self . _compliant_expr , "dt" , "total_minutes"
63+ return self . _compliant_expr . _reuse_series_namespace_implementation (
64+ "dt" , "total_minutes"
6765 )
6866
6967 def total_seconds (self : Self ) -> PandasLikeExpr :
70- return reuse_series_namespace_implementation (
71- self . _compliant_expr , "dt" , "total_seconds"
68+ return self . _compliant_expr . _reuse_series_namespace_implementation (
69+ "dt" , "total_seconds"
7270 )
7371
7472 def total_milliseconds (self : Self ) -> PandasLikeExpr :
75- return reuse_series_namespace_implementation (
76- self . _compliant_expr , "dt" , "total_milliseconds"
73+ return self . _compliant_expr . _reuse_series_namespace_implementation (
74+ "dt" , "total_milliseconds"
7775 )
7876
7977 def total_microseconds (self : Self ) -> PandasLikeExpr :
80- return reuse_series_namespace_implementation (
81- self . _compliant_expr , "dt" , "total_microseconds"
78+ return self . _compliant_expr . _reuse_series_namespace_implementation (
79+ "dt" , "total_microseconds"
8280 )
8381
8482 def total_nanoseconds (self : Self ) -> PandasLikeExpr :
85- return reuse_series_namespace_implementation (
86- self . _compliant_expr , "dt" , "total_nanoseconds"
83+ return self . _compliant_expr . _reuse_series_namespace_implementation (
84+ "dt" , "total_nanoseconds"
8785 )
8886
8987 def to_string (self : Self , format : str ) -> PandasLikeExpr : # noqa: A002
90- return reuse_series_namespace_implementation (
91- self . _compliant_expr , "dt" , "to_string" , format = format
88+ return self . _compliant_expr . _reuse_series_namespace_implementation (
89+ "dt" , "to_string" , format = format
9290 )
9391
9492 def replace_time_zone (self : Self , time_zone : str | None ) -> PandasLikeExpr :
95- return reuse_series_namespace_implementation (
96- self . _compliant_expr , "dt" , "replace_time_zone" , time_zone = time_zone
93+ return self . _compliant_expr . _reuse_series_namespace_implementation (
94+ "dt" , "replace_time_zone" , time_zone = time_zone
9795 )
9896
9997 def convert_time_zone (self : Self , time_zone : str ) -> PandasLikeExpr :
100- return reuse_series_namespace_implementation (
101- self . _compliant_expr , "dt" , "convert_time_zone" , time_zone = time_zone
98+ return self . _compliant_expr . _reuse_series_namespace_implementation (
99+ "dt" , "convert_time_zone" , time_zone = time_zone
102100 )
103101
104102 def timestamp (self : Self , time_unit : TimeUnit ) -> PandasLikeExpr :
105- return reuse_series_namespace_implementation (
106- self . _compliant_expr , "dt" , "timestamp" , time_unit = time_unit
103+ return self . _compliant_expr . _reuse_series_namespace_implementation (
104+ "dt" , "timestamp" , time_unit = time_unit
107105 )
0 commit comments