Great cars! Make sure to take care of it. Mazda partnered with Toyota in 2015 and their products have been increasing in quality for a while now. 2017 was towards the end of that generation and the kinks should have been worked out.
Scotty talks about modern Mazdas
Scotty talks about a 2014 Mazda SUV with Mazda Skyactiv technology
Scotty talks about (2018 Mazda) Toyota/Mazda relationship and quality improvements
Scotty talks about Mazda reliability in his Asian car video (10:08-10:46)
If I were you I would not regret your purchase. Probably more reliable than 80% of the market, far from a money-pit. Pretty good driving dynamics, performance, and value.
You can see this because Scotty used to say "I'm not a fan of Mazda" and "they tend to have this problem" when asked about them but especially in the last year he started calling Mazdas "excellent" and "very high quality."
The 2014-2018 years specifically are very good but he isn't a fan of the last generation with the cylinder deactivation.
Generally, Mazda is seen as the 3rd most reliable car brand, Scotty ranking it so, and I do as well.
Mazda are very good cars. They have gotten much better getting away from Ford. They have recently teamed up with Toyota. They are not far off from Honda/Toyota quality.