Annotate/joining table with compound keys

When we want to annotate Table A with Table B when the keys for Table B is [‘locus’, ‘alleles’], which is a compound key with two fields. How can I pass to the
Table_A.annotate(B = Table_B[Table_A.xxxxxxx])

I can update the keys for Table A to the same keys as Table B, but that is not ideal:
Table_A = Table_A.key_by([‘locus’, ‘alleles’])
New_table = Table_A.annotate(B = Table_B[Table_A.key])

Any other ways to do it? Thanks!

Huan

What’s not ideal about updating the key? Changing the key (and thus enabling annotation/joining) is an expensive operation. It sorts the dataset. It seems reasonable that you have to explicitly request that.

That said, I think y[x.locus, x.alleles] works