make pending_files_for_dataset sideeffect free