I earned non-resident income, but W2 only shows resident state

I live in CA but work for a NY company. My W2 only lists CA wages. Do I still need to file both states?