File tree 1 file changed +1
-18
lines changed
1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 14
14
15
15
from __future__ import annotations
16
16
17
- import typing
18
-
19
- import ibis .expr .types as ibis_types
20
-
21
17
import bigframes .dataframe
22
18
import bigframes .operations
23
19
import bigframes .operations .base
24
20
import bigframes .series
25
21
import third_party .bigframes_vendored .pandas .core .arrays .arrow .accessors as vendoracessors
26
22
27
23
28
- class StructField (bigframes .operations .UnaryOp ):
29
- def __init__ (self , name_or_index : str | int ):
30
- self ._name_or_index = name_or_index
31
-
32
- def _as_ibis (self , x : ibis_types .Value ):
33
- struct_value = typing .cast (ibis_types .StructValue , x )
34
- if isinstance (self ._name_or_index , str ):
35
- name = self ._name_or_index
36
- else :
37
- name = struct_value .names [self ._name_or_index ]
38
- return struct_value [name ].name (name )
39
-
40
-
41
24
class StructAccessor (
42
25
bigframes .operations .base .SeriesMethods , vendoracessors .StructAccessor
43
26
):
44
27
__doc__ = vendoracessors .StructAccessor .__doc__
45
28
46
29
def field (self , name_or_index : str | int ) -> bigframes .series .Series :
47
- series = self ._apply_unary_op (StructField (name_or_index ))
30
+ series = self ._apply_unary_op (bigframes . operations . StructFieldOp (name_or_index ))
48
31
if isinstance (name_or_index , str ):
49
32
name = name_or_index
50
33
else :
You can’t perform that action at this time.
0 commit comments