blob: be5aa4b393e65c53683f1697bb359ff53ab8be7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
from __future__ import annotations
from typing import TYPE_CHECKING
import pyarrow.compute as pc
from narwhals._arrow.utils import ArrowSeriesNamespace
if TYPE_CHECKING:
from narwhals._arrow.series import ArrowSeries
class ArrowSeriesStructNamespace(ArrowSeriesNamespace):
def field(self, name: str) -> ArrowSeries:
return self.with_native(pc.struct_field(self.native, name)).alias(name)
|