File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2204,10 +2204,13 @@ def _extract_compliant(self, arg: Any) -> Any:
22042204 if arg ._metadata .n_orderable_ops :
22052205 msg = (
22062206 "Order-dependent expressions are not supported for use in LazyFrame.\n \n "
2207- "Hints:\n "
2208- "- Instead of `lf.select(nw.col('a').sort())`, use `lf.select('a').sort()`.\n "
2209- "- Instead of `lf.select(nw.col('a').cum_sum())`, use\n "
2210- " `lf.select(nw.col('a').cum_sum().over(order_by='date'))`.\n \n "
2207+ "Hint: To make the expression valid, use `.over` with `order_by` specified.\n \n "
2208+ "For example, if you wrote `nw.col('price').cum_sum()` and you have a column\n "
2209+ "`'date'` which orders your data, then replace:\n \n "
2210+ " nw.col('price').cum_sum()\n \n "
2211+ " with:\n \n "
2212+ " nw.col('price').cum_sum().over(order_by='date')\n "
2213+ " ^^^^^^^^^^^^^^^^^^^^^^\n \n "
22112214 "See https://narwhals-dev.github.io/narwhals/concepts/order_dependence/."
22122215 )
22132216 raise OrderDependentExprError (msg )
You can’t perform that action at this time.
0 commit comments