Skip to content

ColumnRef

pydantable.expressions.ColumnRef

Bases: Expr

Named column with an explicit Python annotation used for Rust typing.

Source code in python/pydantable/expressions.py
class ColumnRef(Expr):  # type: ignore[override]
    """Named column with an explicit Python annotation used for Rust typing."""

    def __init__(self, *, name: str, dtype: Any):
        self._column_name = name
        rust_expr = get_expression_runtime().make_column_ref(
            name=name, dtype_annotation=dtype
        )
        super().__init__(rust_expr=rust_expr)

    def __repr__(self) -> str:
        return f"ColumnRef({self._column_name!r}, dtype={self.dtype!r})"