Allowed wiring methods for running power between two structures above a walkway
What you're after is called messenger supported wiring, and it's an established part of the NEC
The good news is that what you're after is quite possible within the NEC, using a wiring method called messenger supported wiring.  In short, this involves suspending a steel messenger wire between the two structures, and then using that messenger to support electrical cables or wires.  This works much the same way as overhead utility wiring; in fact, you could use a length of utility triplex for this job, but it'd be more trouble than its worth.
The bad news is that like an overhead utility service drop, you'll need to get some elevation on these wires to keep people from blundering into them face-first.  NEC 225.18 requires the lowest point of the wire to be at a minimum of 10' from the ground in a typical situation (using triplex). While this is less than what'd be required for an actual utility service drop, it would require some sort of mast.
However, given that you'll be running a UF cable on the messenger in all likelihood, you can use a metal strut channel or wood pole at each end with the UF and messenger attached to them instead of conduit and weatherheads, or even dispense with the mast altogether (with AHJ approval) as 225.18 may not apply to a fully insulated cable on a messenger.  This doesn't exempt you from providing a proper drip loop though!
When you're running the UF up on the messenger, you'll need to lash it to that messenger wire, or clip cable saddles onto the messenger and run the UF through those.  You'll also need to ground the messenger wire itself; this can be done by using a split bolt to clamp an 8AWG bare wire to it at the pergola end, then running that wire down to whatever you're using as a disconnect and landing it there.
Speaking of disconnects, you have a couple of options for that.  For a single circuit, a simple lightswitch, or perhaps a key-operated one if there are receptacles at the pergola, will do the trick.  A weatherproof box and cover would certainly be in order for such, though!  If your run is more substantial than that, though, you'll want to use a non-fused pullout disconnect box (air conditioner disconnect) instead.  Either way, you'll want a compression grounding wire fitting (sometimes called a &quot;Kenny clamp&quot;) to bring the messenger ground into the box, and a second drip-loop + weathertight fitting/gland to bring the UF cable into the box via the bottom or side. (I wouldn't trust a NEMA 3R hub to seal properly against a UF fitting.)
If you want to use conduit instead
If you wanted to use conduit instead of a MSW run for such a short distance, that is possible as well.  Given you're only spanning 3' eave-to-eave, you could technically do this with LFMC provided it's attached securely to both the house and pergola eaves, as the NEC permits 4½' between supports for LFMC.  However, a sturdier wiring method such as rigid conduit may be a better choice given the potential forces involved.  If you do go with rigid conduit, though, NEC 300.4(H) means that you'll need to put an expansion-deflection fitting or two in your run, though, to take up relative motion between the two buildings.  (Which can be very significant indeed given what gets up to shakin' where you live.)