Here in Illinois a union is code. It does not have to be a dielectric union you can use a brass IPS union with a male adapter. Underlining in the code is by me.
Section 890.350 Unions
Unions may be used in the drainage and venting system when accessibly located above ground. Unions shall be installed in a water supply system within 5 feet of regulating equipment, water heaters, water conditioning tanks, water conditioning equipment, pumps, and similar equipment which may require service by removal or replacement. Where small equipment may be unscrewed, only one union shall be required.
a) Drainage System. Unions may be used in the trap seal and on the inlet and outlet side of the trap. Unions shall have metal to metal seats except that plastic unions may have plastic to plastic seats.
b) Water Supply System. Unions in the water supply system shall be metal to metal with ground seats, except that plastic to metal unions may utilize durable, non-toxic, impervious gaskets. Unions between copper pipe/tubing and dissimilar metals shall either be made with a brass converter fitting or be a dielectric type union.