diff --git a/narwhals/_duckdb/expr.py b/narwhals/_duckdb/expr.py index 544381addf..39c16c0458 100644 --- a/narwhals/_duckdb/expr.py +++ b/narwhals/_duckdb/expr.py @@ -317,7 +317,10 @@ def func(_input: duckdb.Expression) -> duckdb.Expression: condition=(count == lit(1)), value=lit(float("nan")) ).otherwise( CaseExpression(condition=(count == lit(2)), value=lit(0.0)).otherwise( + # Adjust population skewness by correction factor to get sample skewness FunctionExpression("skewness", _input) + * (count - lit(2)) + / FunctionExpression("sqrt", count * (count - lit(1))) ) ) ) diff --git a/tests/expr_and_series/unary_test.py b/tests/expr_and_series/unary_test.py index 618a477d7f..280ace8258 100644 --- a/tests/expr_and_series/unary_test.py +++ b/tests/expr_and_series/unary_test.py @@ -10,9 +10,7 @@ from tests.utils import assert_equal_data -def test_unary(constructor: Constructor, request: pytest.FixtureRequest) -> None: - if "duckdb" in str(constructor): - request.applymarker(pytest.mark.xfail) +def test_unary(constructor: Constructor) -> None: data = { "a": [1, 3, 2], "b": [4, 4, 6],