Multiple State Wages and Taxes

I have 2 states wages and income taxes in W-2. One state is CA and another state is NY. I didn't stay anytime in NY during 2022. Should I file CA schedule S or file NY NR for full refund? Or should I do both? Thank you!