@@ -139,6 +139,9 @@ def __rmod__(self, other: Any) -> Expr:
139
139
140
140
# Everything else
141
141
def __getattr__ (self , attr : str , / ) -> Callable [..., Expr ]:
142
+ if attr in Series ._accessors :
143
+ return NamespaceExpr (self , attr )
144
+
142
145
def func (df : DataFrame , * args : Any , ** kwargs : Any ) -> Any :
143
146
parsed_args = _parse_args (df , * args )
144
147
parsed_kwargs = _parse_kwargs (df , ** kwargs )
@@ -170,31 +173,6 @@ def wrapper(*args: Any, **kwargs: Any) -> Expr:
170
173
def __repr__ (self ) -> str :
171
174
return self ._repr_str or "Expr(...)"
172
175
173
- # Namespaces
174
- @property
175
- def dt (self ) -> NamespaceExpr :
176
- return NamespaceExpr (self , "dt" )
177
-
178
- @property
179
- def str (self ) -> NamespaceExpr :
180
- return NamespaceExpr (self , "str" )
181
-
182
- @property
183
- def cat (self ) -> NamespaceExpr :
184
- return NamespaceExpr (self , "cat" )
185
-
186
- @property
187
- def list (self ) -> NamespaceExpr :
188
- return NamespaceExpr (self , "list" )
189
-
190
- @property
191
- def sparse (self ) -> NamespaceExpr :
192
- return NamespaceExpr (self , "sparse" )
193
-
194
- @property
195
- def struct (self ) -> NamespaceExpr :
196
- return NamespaceExpr (self , "struct" )
197
-
198
176
199
177
class NamespaceExpr :
200
178
def __init__ (self , func : Expr , namespace : str ) -> None :
0 commit comments