@pytest.mark.parametrize('func', ('var', 'std'))
def test_timedelta_stat_reduction(sql_with_timedeltas, func):
    sym = symbol('s', discover(sql_with_timedeltas))
    expr = getattr(sym.N, func)()

    deltas = pd.Series([timedelta(seconds=n) for n in range(10)])
    expected = timedelta(
        seconds=getattr(deltas.astype('int64') / 1e9, func)(ddof=expr.unbiased)
    )
    assert compute(expr, sql_with_timedeltas, return_type=timedelta) == expected
dataset/ETHPy150Open blaze/blaze/blaze/compute/tests/test_postgresql_compute.py/test_timedelta_stat_reduction/original