While it's generally good to love your partner for who they really are, lying to yourself about their qualities isn't actually that bad. In fact, a little bit of self-delusion may actually make you both happier in the long run. In this video from the New York Magazine YouTube channel, The Science of Us explains how idealising your significant other a little bit can be good for the longevity of your relationship. According to one three-year long study, couples that believe their partners have certain "perfect" qualities end up being happier in the long run, even if those qualities aren't actually present in their partners. "Positive illusions", a form of self-deception that makes you feel better toward a significant other, even create a self-fulfilling prophecy of sorts. If you always think highly of your sweetheart, they will probably want to live up to your expectations. Your delusions might rub off on your partner and they will start behaving how you want them to behave.
Of course, there's definitely a line that you shouldn't cross. You don't ever want to lie to yourself about an abusive or unhealthy relationship, so make sure your delusions aren't trying to hide some truly terrible stuff. You can read more about the related study here.