Both are excellent phones, but it all comes down to what you prioritize:
1) Do you want the fastest / latest updates (Security or Android)? If so, go with Pixel 2.
2) Do you want the best camera? If so, go with Pixel 2.
3) Do you want a headphone jack, or wireless charging, or stylus, or...