Should I avoid placing a SMPS inductor close to a magnetometer?
The datasheet says this in the application hints.


  High current wiring effects
  
  High current in wiring and printed circuit traces can be the cause of errors in magnetic field measurements for compassing.
  Conducto-generated magnetic fields add to earth’s magnetic field, creating errors in compass heading computation.
  Keep currents that are higher than 10 mA a few millimeters further away from the sensor IC.


2 A is way more than 10 mA,  and an inductor is a obviously going to create a stronger magnetic field than a straight wire. A good guesstimate is that you're going to have interference problems even if you shield the inductor.