Columns and types¶
Column ¶
group ¶
group() -> Self
Mark column as a group key for use in an aggregate DataFrame constructor.
Example::
class Agg(ts.DataFrame):
name: ts.String
total: ts.Int
Agg(df, name=df.name.group(), total=ts.sum(df.age))
The returned value is a _GroupColumn sentinel. Arithmetic and comparison
operations on it raise TypeError — operate on the field after construction
instead.
cast ¶
cast(dataType: BooleanType) -> Bool
cast(dataType: BinaryType) -> Binary
cast(dataType: DecimalType) -> Decimal
cast(dataType: DoubleType) -> Double
cast(dataType: IntegerType) -> Integer
cast(dataType: StringType) -> String
cast(dataType: TimestampType) -> Timestamp
cast(dataType: TimestampNTZType) -> TimestampNTZ
cast(dataType: U) -> Column[U]
over ¶
over(window: WindowSpec | WindowSpec) -> Self
Evaluate this column over a window, like pyspark.sql.Column.over.
An aggregate (tsf.sum(col).over(w)) becomes a plain column of the same
type, so the DataFrame constructor projects it instead of grouping.
StringOf ¶
Bases: String
String column restricted to the literal values in T.
Use with Literal, e.g. StringOf[Literal["open", "closed"]].
The restriction is static only; values are not validated at runtime.
IntOf ¶
Bases: Integer
Integer column restricted to the literal values in T.
Use with Literal, e.g. IntOf[Literal[1, 2, 3]].
The restriction is static only; values are not validated at runtime.
Arithmetic results fall back to plain Integer.
Bool ¶
Bases: Column[BooleanType]
String ¶
Bases: _StringOpsMixin, Column[StringType]
Binary ¶
Bases: _BinaryOpsMixin, Column[BinaryType]
Integer ¶
Bases: _IntOpsMixin, Column[IntegerType]
Double ¶
Bases: _FloatOpsMixin, Column[DoubleType]
Decimal ¶
Bases: _DecimalOpsMixin, Column[DecimalType]
Timestamp ¶
Bases: _TimestampOpsMixin, Column[TimestampType]
TimestampNTZ ¶
Bases: _TimestampOpsMixin, Column[TimestampNTZType]