No law partner of the county attorney, or attorney having an office with the county attorney, shall appear for the defendant in any criminal action which it is the duty of the county attorney to prosecute.