@pytest.mark.parametrize('attr, args, expected', [('days', [], 7), ('nanoseconds', [], 0), ('seconds', [], 0), ('total_seconds', [], 604800.0)])
def test_td_namespace(attr, args, expected):
 df = DataFrame({'span': [timedelta(7)]})
 t = symbol('t', 'var * {span: timedelta}')
 expr = getattr(t.span.dt, attr)(*args)
 assert_series_equal(compute(expr, df), Series(expected, name=expr._name))

@ pytest . mark . parametrize ( 'attr, args, expected' , [ ( 'days' , [ ] , 7 ) , ( 'nanoseconds' , [ ] , 0 ) , ( 'seconds' , [ ] , 0 ) , ( 'total_seconds' , [ ] , 604800.0 ) ] ) def test_td_namespace ( attr , args , expected ) : df = DataFrame ( { 'span' : [ timedelta ( 7 ) ] } ) t = symbol ( 't' , 'var * {span: timedelta}' ) expr = getattr ( t . span . dt , attr ) ( * args ) assert_series_equal ( compute ( expr , df ) , Series ( expected , name = expr . _name ) )
timedelta functions .