ValueError: pos_label=1 is not a valid label: array(['N', 'Y'], dtype='<U1')
pos_label is an argument of scikit-learn's precision_score (docs); its purpose is, well, to indicate which label is the positive one and, if not given explicitly (like in your case here), it assumes the default value of 1 (again, check the docs).

Since it seems that the positive label in your case is 'Y', replace the last line with:

print("Precision:",metrics.precision_score(y_test, y_pred, pos_label='Y'))