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: ArrowExpr) -> None:
1614 self ._compliant_expr = expr
1715
1816 def to_string (self : Self , format : str ) -> ArrowExpr : # noqa: A002
19- return reuse_series_namespace_implementation (
20- self . _compliant_expr , "dt" , "to_string" , format = format
17+ return self . _compliant_expr . _reuse_series_namespace_implementation (
18+ "dt" , "to_string" , format = format
2119 )
2220
2321 def replace_time_zone (self : Self , time_zone : str | None ) -> ArrowExpr :
24- return reuse_series_namespace_implementation (
25- self . _compliant_expr , "dt" , "replace_time_zone" , time_zone = time_zone
22+ return self . _compliant_expr . _reuse_series_namespace_implementation (
23+ "dt" , "replace_time_zone" , time_zone = time_zone
2624 )
2725
2826 def convert_time_zone (self : Self , time_zone : str ) -> ArrowExpr :
29- return reuse_series_namespace_implementation (
30- self . _compliant_expr , "dt" , "convert_time_zone" , time_zone = time_zone
27+ return self . _compliant_expr . _reuse_series_namespace_implementation (
28+ "dt" , "convert_time_zone" , time_zone = time_zone
3129 )
3230
3331 def timestamp (self : Self , time_unit : TimeUnit ) -> ArrowExpr :
34- return reuse_series_namespace_implementation (
35- self . _compliant_expr , "dt" , "timestamp" , time_unit = time_unit
32+ return self . _compliant_expr . _reuse_series_namespace_implementation (
33+ "dt" , "timestamp" , time_unit = time_unit
3634 )
3735
3836 def date (self : Self ) -> ArrowExpr :
39- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "date" )
37+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "date" )
4038
4139 def year (self : Self ) -> ArrowExpr :
42- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "year" )
40+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "year" )
4341
4442 def month (self : Self ) -> ArrowExpr :
45- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "month" )
43+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "month" )
4644
4745 def day (self : Self ) -> ArrowExpr :
48- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "day" )
46+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "day" )
4947
5048 def hour (self : Self ) -> ArrowExpr :
51- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "hour" )
49+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "hour" )
5250
5351 def minute (self : Self ) -> ArrowExpr :
54- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "minute" )
52+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "minute" )
5553
5654 def second (self : Self ) -> ArrowExpr :
57- return reuse_series_namespace_implementation ( self ._compliant_expr , "dt" , "second" )
55+ return self ._compliant_expr . _reuse_series_namespace_implementation ( "dt" , "second" )
5856
5957 def millisecond (self : Self ) -> ArrowExpr :
60- return reuse_series_namespace_implementation (
61- self . _compliant_expr , "dt" , "millisecond"
58+ return self . _compliant_expr . _reuse_series_namespace_implementation (
59+ "dt" , "millisecond"
6260 )
6361
6462 def microsecond (self : Self ) -> ArrowExpr :
65- return reuse_series_namespace_implementation (
66- self . _compliant_expr , "dt" , "microsecond"
63+ return self . _compliant_expr . _reuse_series_namespace_implementation (
64+ "dt" , "microsecond"
6765 )
6866
6967 def nanosecond (self : Self ) -> ArrowExpr :
70- return reuse_series_namespace_implementation (
71- self . _compliant_expr , "dt" , "nanosecond"
68+ return self . _compliant_expr . _reuse_series_namespace_implementation (
69+ "dt" , "nanosecond"
7270 )
7371
7472 def ordinal_day (self : Self ) -> ArrowExpr :
75- return reuse_series_namespace_implementation (
76- self . _compliant_expr , "dt" , "ordinal_day"
73+ return self . _compliant_expr . _reuse_series_namespace_implementation (
74+ "dt" , "ordinal_day"
7775 )
7876
7977 def weekday (self : Self ) -> ArrowExpr :
80- return reuse_series_namespace_implementation (
81- self . _compliant_expr , "dt" , "weekday"
78+ return self . _compliant_expr . _reuse_series_namespace_implementation (
79+ "dt" , "weekday"
8280 )
8381
8482 def total_minutes (self : Self ) -> ArrowExpr :
85- return reuse_series_namespace_implementation (
86- self . _compliant_expr , "dt" , "total_minutes"
83+ return self . _compliant_expr . _reuse_series_namespace_implementation (
84+ "dt" , "total_minutes"
8785 )
8886
8987 def total_seconds (self : Self ) -> ArrowExpr :
90- return reuse_series_namespace_implementation (
91- self . _compliant_expr , "dt" , "total_seconds"
88+ return self . _compliant_expr . _reuse_series_namespace_implementation (
89+ "dt" , "total_seconds"
9290 )
9391
9492 def total_milliseconds (self : Self ) -> ArrowExpr :
95- return reuse_series_namespace_implementation (
96- self . _compliant_expr , "dt" , "total_milliseconds"
93+ return self . _compliant_expr . _reuse_series_namespace_implementation (
94+ "dt" , "total_milliseconds"
9795 )
9896
9997 def total_microseconds (self : Self ) -> ArrowExpr :
100- return reuse_series_namespace_implementation (
101- self . _compliant_expr , "dt" , "total_microseconds"
98+ return self . _compliant_expr . _reuse_series_namespace_implementation (
99+ "dt" , "total_microseconds"
102100 )
103101
104102 def total_nanoseconds (self : Self ) -> ArrowExpr :
105- return reuse_series_namespace_implementation (
106- self . _compliant_expr , "dt" , "total_nanoseconds"
103+ return self . _compliant_expr . _reuse_series_namespace_implementation (
104+ "dt" , "total_nanoseconds"
107105 )
0 commit comments