NADP-dependent dehydrogenase with broad substrate specificity acting on 3-hydroxy acids. Catalyzes the NADP-dependent oxidation of L-allo-threonine to L-2-amino-3-keto-butyrate, which is spontaneously decarboxylated into aminoacetone. Also acts on D-threonine, L-serine, D-serine, D-3-hydroxyisobutyrate, L-3-hydroxyisobutyrate, D-glycerate and L-glycerate. Able to catalyze the reduction of the malonic semialdehyde to 3-hydroxypropionic acid. YdfG is apparently supplementing RutE, the presumed malonic semialdehyde reductase involved in pyrimidine degradation since both are able to detoxify malonic semialdehyde. 3-hydroxypropanoate + NADP(+) = 3-oxopropanoate + H(+) + NADPH L-allo-threonine + NADP(+) = aminoacetone + CO2 + NADPH Homotetramer. Belongs to the short-chain dehydrogenases/reductases (SDR) family.