A booking ledger needs fees from a lookup indexed by band. Build the normal join first, then add a guard against repeated lookup labels. These are separate checks, so you can submit after either step.
b.index.is_unique is a Boolean: it is True only when no index label repeats. Before the join, use if not b.index.is_unique: followed by raise ValueError("Duplicate fee-band keys"). Raising an error stops this function instead of returning misleading rows. The error message can be your own.
For a valid lookup, set the left index to band and use a left join. The supplied A booking gets fee 5; B stays present with a missing fee.
Edit main.py, press Run to inspect the result, then Submit to check each task.
attach_bands(a, b) return a left join of b onto a, using band as the left index.ValueError before joining.Put the uniqueness guard before the return so duplicate lookups never reach the join.