test margins with dictionary aggfunc