I get more aggrevated when I see unions inside the cabinet .
I just ran into that on a unit heater I changed. It had the union and gas cock inside the unit. The building was located 200ft from the main building and had NO shut off for the secondary building that I could find. Good thing it was low pressure, I had to remove the gas pipe going into the unit and install a new gas cock on the fly.
Actually, its not. It is called a "sediment trap". Look in your gas code. Drips are installed in the lowest point of the gas piping usually right inside the house from the meter and required only when you have 'wet gas'. Rarely required anymore. Now, everyone calls them "drip legs" or "dirt legs" but those are incorrect terms, similar to Southerners ordering a "Coke" when they want any brand of soda--generically speaking.
The code does not prevent the installation of the trap from being located inside the cabinet but it is rather awkward. Cannot see it clearly but there must be a ground union joint so the unit can be disconncted and there must be a listed shutoff within 6 feet. As long as this pic is the actual orientation of the trap, it is acceptable.