if you have a gold / silver card then the bonus avois can be earned as a code share on non BA operated flights if there is a BA flight number. So with a gold card HEL-JFK on AY gets double avios if I book with a BA flight number but booked as an AY flight number there is no bonus.
On the other hand there are plenty of disadvantages due to a ticket issued by the non-operating airline. You would not be able to pay for seat reservations or extra luggage online with AY with a BA ticket on an AY operated flight and if you try to do things via ba.com you are redirected to the AY website which then gives an error "sorry this flight is not operated by Finnair" when in reality it is operated by finnair but booked as a codeshare.
Sometimes it's worth avoiding a code share though. BA sometimes have double/triple avios promotions and these are usually limited to your first N flights with BA (eg first 8 flights). For me it means for something like HEL-LHR-KUL I should book the HEL-LHR as non codeshare (ie AY flight number) since then only the long haul segment counts towards one of my 8 flights at triple avios.
Booking classes can also vary by codeshare. eg a CX premium economy ticket for HEL-LHR-HKG. The HEL-LHR will book into Y with the HEL-LHR flight booked as AY flight number but H with a CX flight number. This means 40 tier points for HEL-LHR (AY flight number) or 20 tier points (CX flight number).