fix the number of partitions during window()
address comments