works for partition_by as well