diff --git a/_duckdb-stubs/__init__.pyi b/_duckdb-stubs/__init__.pyi index 67830ad3..f5d906ee 100644 --- a/_duckdb-stubs/__init__.pyi +++ b/_duckdb-stubs/__init__.pyi @@ -471,7 +471,7 @@ class DuckDBPyRelation: self, aggr_expr: Expression | str | list[Expression], group_expr: Expression | str = "" ) -> DuckDBPyRelation: ... def any_value( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def apply( self, @@ -489,20 +489,20 @@ class DuckDBPyRelation: ) -> DuckDBPyRelation: ... def arrow(self, batch_size: pytyping.SupportsInt = 1000000) -> pyarrow.lib.RecordBatchReader: ... def avg( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def bit_and( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def bit_or( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def bit_xor( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def bitstring_agg( self, - column: str, + expression: str, min: int | None = None, max: int | None = None, groups: str = "", @@ -510,14 +510,14 @@ class DuckDBPyRelation: projected_columns: str = "", ) -> DuckDBPyRelation: ... def bool_and( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def bool_or( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def close(self) -> None: ... def count( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def create(self, table_name: str) -> None: ... def create_view(self, view_name: str, replace: bool = True) -> DuckDBPyRelation: ... @@ -531,7 +531,7 @@ class DuckDBPyRelation: def execute(self) -> DuckDBPyRelation: ... def explain(self, type: ExplainType = ExplainType.STANDARD) -> str: ... def favg( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def fetch_arrow_reader(self, batch_size: pytyping.SupportsInt = 1000000) -> pyarrow.lib.RecordBatchReader: ... def fetch_arrow_table(self, batch_size: pytyping.SupportsInt = 1000000) -> pyarrow.lib.Table: ... @@ -545,14 +545,14 @@ class DuckDBPyRelation: def fetchnumpy(self) -> dict[str, np.typing.NDArray[pytyping.Any] | pandas.Categorical]: ... def fetchone(self) -> tuple[pytyping.Any, ...] | None: ... def filter(self, filter_expr: Expression | str) -> DuckDBPyRelation: ... - def first(self, column: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... - def first_value(self, column: str, window_spec: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... + def first(self, expression: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... + def first_value(self, expression: str, window_spec: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... def fsum( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... - def geomean(self, column: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... + def geomean(self, expression: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... def histogram( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def insert(self, values: pytyping.List[object]) -> None: ... def insert_into(self, table_name: str) -> None: ... @@ -562,18 +562,18 @@ class DuckDBPyRelation: ) -> DuckDBPyRelation: ... def lag( self, - column: str, + expression: str, window_spec: str, offset: pytyping.SupportsInt = 1, default_value: str = "NULL", ignore_nulls: bool = False, projected_columns: str = "", ) -> DuckDBPyRelation: ... - def last(self, column: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... - def last_value(self, column: str, window_spec: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... + def last(self, expression: str, groups: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... + def last_value(self, expression: str, window_spec: str = "", projected_columns: str = "") -> DuckDBPyRelation: ... def lead( self, - column: str, + expression: str, window_spec: str, offset: pytyping.SupportsInt = 1, default_value: str = "NULL", @@ -582,32 +582,32 @@ class DuckDBPyRelation: ) -> DuckDBPyRelation: ... def limit(self, n: pytyping.SupportsInt, offset: pytyping.SupportsInt = 0) -> DuckDBPyRelation: ... def list( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def map( self, map_function: Callable[..., pytyping.Any], *, schema: dict[str, sqltypes.DuckDBPyType] | None = None ) -> DuckDBPyRelation: ... def max( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def mean( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def median( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def min( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def mode( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def n_tile( self, window_spec: str, num_buckets: pytyping.SupportsInt, projected_columns: str = "" ) -> DuckDBPyRelation: ... def nth_value( self, - column: str, + expression: str, window_spec: str, offset: pytyping.SupportsInt, ignore_nulls: bool = False, @@ -626,12 +626,12 @@ class DuckDBPyRelation: self, batch_size: pytyping.SupportsInt = 1000000, *, lazy: bool = False ) -> pytyping.Union[polars.DataFrame, polars.LazyFrame]: ... def product( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def project(self, *args: str | Expression, groups: str = "") -> DuckDBPyRelation: ... def quantile( self, - column: str, + expression: str, q: float | pytyping.List[float] = 0.5, groups: str = "", window_spec: str = "", @@ -639,7 +639,7 @@ class DuckDBPyRelation: ) -> DuckDBPyRelation: ... def quantile_cont( self, - column: str, + expression: str, q: float | pytyping.List[float] = 0.5, groups: str = "", window_spec: str = "", @@ -647,7 +647,7 @@ class DuckDBPyRelation: ) -> DuckDBPyRelation: ... def quantile_disc( self, - column: str, + expression: str, q: float | pytyping.List[float] = 0.5, groups: str = "", window_spec: str = "", @@ -674,22 +674,22 @@ class DuckDBPyRelation: def sort(self, *args: Expression) -> DuckDBPyRelation: ... def sql_query(self) -> str: ... def std( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def stddev( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def stddev_pop( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def stddev_samp( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def string_agg( - self, column: str, sep: str = ",", groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, sep: str = ",", groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def sum( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def tf(self) -> dict[str, tensorflow.Tensor]: ... def to_arrow_table(self, batch_size: pytyping.SupportsInt = 1000000) -> pyarrow.lib.Table: ... @@ -737,18 +737,18 @@ class DuckDBPyRelation: def union(self, union_rel: DuckDBPyRelation) -> DuckDBPyRelation: ... def unique(self, unique_aggr: str) -> DuckDBPyRelation: ... def update(self, set: Expression | str, *, condition: Expression | str | None = None) -> None: ... - def value_counts(self, column: str, groups: str = "") -> DuckDBPyRelation: ... + def value_counts(self, expression: str, groups: str = "") -> DuckDBPyRelation: ... def var( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def var_pop( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def var_samp( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def variance( - self, column: str, groups: str = "", window_spec: str = "", projected_columns: str = "" + self, expression: str, groups: str = "", window_spec: str = "", projected_columns: str = "" ) -> DuckDBPyRelation: ... def write_csv( self, diff --git a/src/duckdb_py/pyrelation/initialize.cpp b/src/duckdb_py/pyrelation/initialize.cpp index 35eeff40..c8620dc5 100644 --- a/src/duckdb_py/pyrelation/initialize.cpp +++ b/src/duckdb_py/pyrelation/initialize.cpp @@ -95,8 +95,8 @@ static void InitializeConsumers(py::class_ &m) { static void InitializeAggregates(py::class_ &m) { /* General aggregate functions */ - m.def("any_value", &DuckDBPyRelation::AnyValue, "Returns the first non-null value from a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + m.def("any_value", &DuckDBPyRelation::AnyValue, "Returns the first non-null value from a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") .def("arg_max", &DuckDBPyRelation::ArgMax, "Finds the row with the maximum value for a value column and returns the value of that row for an " "argument column", @@ -107,82 +107,98 @@ static void InitializeAggregates(py::class_ &m) { "argument column", py::arg("arg_column"), py::arg("value_column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); - DefineMethod({"avg", "mean"}, m, &DuckDBPyRelation::Avg, "Computes the average on a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", + DefineMethod({"avg", "mean"}, m, &DuckDBPyRelation::Avg, "Computes the average of a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); - m.def("bit_and", &DuckDBPyRelation::BitAnd, "Computes the bitwise AND of all bits present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("bit_or", &DuckDBPyRelation::BitOr, "Computes the bitwise OR of all bits present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("bit_xor", &DuckDBPyRelation::BitXor, "Computes the bitwise XOR of all bits present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + m.def("bit_and", &DuckDBPyRelation::BitAnd, "Computes the bitwise AND of all bits present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("bit_or", &DuckDBPyRelation::BitOr, "Computes the bitwise OR of all bits present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") + .def("bit_xor", &DuckDBPyRelation::BitXor, "Computes the bitwise XOR of all bits present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("bitstring_agg", &DuckDBPyRelation::BitStringAgg, - "Computes a bitstring with bits set for each distinct value in a given column", py::arg("column"), + "Computes a bitstring with bits set for each distinct value in a given expression", py::arg("expression"), py::arg("min") = py::none(), py::arg("max") = py::none(), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("bool_and", &DuckDBPyRelation::BoolAnd, "Computes the logical AND of all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("bool_or", &DuckDBPyRelation::BoolOr, "Computes the logical OR of all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("count", &DuckDBPyRelation::Count, "Computes the number of elements present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("bool_and", &DuckDBPyRelation::BoolAnd, + "Computes the logical AND of all values present in a given expression", py::arg("expression"), + py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("bool_or", &DuckDBPyRelation::BoolOr, + "Computes the logical OR of all values present in a given expression", py::arg("expression"), + py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("count", &DuckDBPyRelation::Count, "Computes the number of elements present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("value_counts", &DuckDBPyRelation::ValueCounts, - "Computes the number of elements present in a given column, also projecting the original column", - py::arg("column"), py::arg("groups") = "") + "Computes the number of elements present in a given expression, also projecting the original expression", + py::arg("expression"), py::arg("groups") = "") .def("favg", &DuckDBPyRelation::FAvg, - "Computes the average of all values present in a given column using a more accurate floating point " + "Computes the average of all values present in a given expression using a more accurate floating point " "summation (Kahan Sum)", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("first", &DuckDBPyRelation::First, "Returns the first value of a given column", py::arg("column"), + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") + .def("first", &DuckDBPyRelation::First, "Returns the first value of a given expression", py::arg("expression"), py::arg("groups") = "", py::arg("projected_columns") = "") .def("fsum", &DuckDBPyRelation::FSum, - "Computes the sum of all values present in a given column using a more accurate floating point " + "Computes the sum of all values present in a given expression using a more accurate floating point " "summation (Kahan Sum)", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("geomean", &DuckDBPyRelation::GeoMean, - "Computes the geometric mean over all values present in a given column", py::arg("column"), + "Computes the geometric mean over all values present in a given expression", py::arg("expression"), py::arg("groups") = "", py::arg("projected_columns") = "") .def("histogram", &DuckDBPyRelation::Histogram, - "Computes the histogram over all values present in a given column", py::arg("column"), + "Computes the histogram over all values present in a given expression", py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("list", &DuckDBPyRelation::List, "Returns a list containing all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("last", &DuckDBPyRelation::Last, "Returns the last value of a given column", py::arg("column"), + .def("list", &DuckDBPyRelation::List, "Returns a list containing all values present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") + .def("last", &DuckDBPyRelation::Last, "Returns the last value of a given expression", py::arg("expression"), py::arg("groups") = "", py::arg("projected_columns") = "") - .def("max", &DuckDBPyRelation::Max, "Returns the maximum value present in a given column", py::arg("column"), - py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("min", &DuckDBPyRelation::Min, "Returns the minimum value present in a given column", py::arg("column"), - py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("product", &DuckDBPyRelation::Product, "Returns the product of all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("max", &DuckDBPyRelation::Max, "Returns the maximum value present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") + .def("min", &DuckDBPyRelation::Min, "Returns the minimum value present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") + .def("product", &DuckDBPyRelation::Product, "Returns the product of all values present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("string_agg", &DuckDBPyRelation::StringAgg, - "Concatenates the values present in a given column with a separator", py::arg("column"), + "Concatenates the values present in a given expression with a separator", py::arg("expression"), py::arg("sep") = ",", py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("sum", &DuckDBPyRelation::Sum, "Computes the sum of all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("sum", &DuckDBPyRelation::Sum, "Computes the sum of all values present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("unique", &DuckDBPyRelation::Unique, "Returns the distinct values in a column.", py::arg("unique_aggr")); /* TODO: Approximate aggregate functions */ /* TODO: Statistical aggregate functions */ - m.def("median", &DuckDBPyRelation::Median, "Computes the median over all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("mode", &DuckDBPyRelation::Mode, "Computes the mode over all values present in a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + m.def("median", &DuckDBPyRelation::Median, "Computes the median over all values present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("mode", &DuckDBPyRelation::Mode, "Computes the mode over all values present in a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = "") .def("quantile_cont", &DuckDBPyRelation::QuantileCont, - "Computes the interpolated quantile value for a given column", py::arg("column"), py::arg("q") = 0.5, - py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); + "Computes the interpolated quantile value for a given expression", py::arg("expression"), + py::arg("q") = 0.5, py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = ""); DefineMethod({"quantile_disc", "quantile"}, m, &DuckDBPyRelation::QuantileDisc, - "Computes the exact quantile value for a given column", py::arg("column"), py::arg("q") = 0.5, + "Computes the exact quantile value for a given expression", py::arg("expression"), py::arg("q") = 0.5, py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); - m.def("stddev_pop", &DuckDBPyRelation::StdPop, "Computes the population standard deviation for a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); + m.def("stddev_pop", &DuckDBPyRelation::StdPop, "Computes the population standard deviation for a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = ""); DefineMethod({"stddev_samp", "stddev", "std"}, m, &DuckDBPyRelation::StdSamp, - "Computes the sample standard deviation for a given column", py::arg("column"), py::arg("groups") = "", - py::arg("window_spec") = "", py::arg("projected_columns") = ""); - m.def("var_pop", &DuckDBPyRelation::VarPop, "Computes the population variance for a given column", - py::arg("column"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); + "Computes the sample standard deviation for a given expression", py::arg("expression"), + py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); + m.def("var_pop", &DuckDBPyRelation::VarPop, "Computes the population variance for a given expression", + py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", + py::arg("projected_columns") = ""); DefineMethod({"var_samp", "variance", "var"}, m, &DuckDBPyRelation::VarSamp, - "Computes the sample variance for a given column", py::arg("column"), py::arg("groups") = "", + "Computes the sample variance for a given expression", py::arg("expression"), py::arg("groups") = "", py::arg("window_spec") = "", py::arg("projected_columns") = ""); } @@ -200,19 +216,19 @@ static void InitializeWindowOperators(py::class_ &m) { .def("cume_dist", &DuckDBPyRelation::CumeDist, "Computes the cumulative distribution within the partition", py::arg("window_spec"), py::arg("projected_columns") = "") .def("first_value", &DuckDBPyRelation::FirstValue, "Computes the first value within the group or partition", - py::arg("column"), py::arg("window_spec") = "", py::arg("projected_columns") = "") + py::arg("expression"), py::arg("window_spec") = "", py::arg("projected_columns") = "") .def("n_tile", &DuckDBPyRelation::NTile, "Divides the partition as equally as possible into num_buckets", py::arg("window_spec"), py::arg("num_buckets"), py::arg("projected_columns") = "") - .def("lag", &DuckDBPyRelation::Lag, "Computes the lag within the partition", py::arg("column"), + .def("lag", &DuckDBPyRelation::Lag, "Computes the lag within the partition", py::arg("expression"), py::arg("window_spec"), py::arg("offset") = 1, py::arg("default_value") = "NULL", py::arg("ignore_nulls") = false, py::arg("projected_columns") = "") .def("last_value", &DuckDBPyRelation::LastValue, "Computes the last value within the group or partition", - py::arg("column"), py::arg("window_spec") = "", py::arg("projected_columns") = "") - .def("lead", &DuckDBPyRelation::Lead, "Computes the lead within the partition", py::arg("column"), + py::arg("expression"), py::arg("window_spec") = "", py::arg("projected_columns") = "") + .def("lead", &DuckDBPyRelation::Lead, "Computes the lead within the partition", py::arg("expression"), py::arg("window_spec"), py::arg("offset") = 1, py::arg("default_value") = "NULL", py::arg("ignore_nulls") = false, py::arg("projected_columns") = "") - .def("nth_value", &DuckDBPyRelation::NthValue, "Computes the nth value within the partition", py::arg("column"), - py::arg("window_spec"), py::arg("offset"), py::arg("ignore_nulls") = false, + .def("nth_value", &DuckDBPyRelation::NthValue, "Computes the nth value within the partition", + py::arg("expression"), py::arg("window_spec"), py::arg("offset"), py::arg("ignore_nulls") = false, py::arg("projected_columns") = ""); }