If a defendant or prosecuting attorney in a criminal action prosecuted by information or complaint in a magistrate court makes an affidavit that he cannot have an impartial trial by reason of the bias or prejudice of the magistrate, the presiding circuit judge of the circuit in which the magistrate court is situated shall appoint a magistrate pro tempore for the trial of such action. The magistrate pro tempore shall preside at the trial and do any other act with reference thereto, as though he were the presiding magistrate of that magistrate court.
SDCL 23A-21-2