As a stop gap, we could remove ORDER BY clauses from inner queries if we don't combine the inner and the outer query. With a warning. This would also solve #275. I wonder if this generates spurious warnings, e.g., for window functions.
Alternatively, we could allow arrange() only at the very last step in the pipe, and transform it to window_order() if additional verbs are added, with a warning. This will be a problem later when we want to support lazy operations for data frames.
For a true solution, we cannot simply delay the computation due to aliasing (#94 (comment)). A few examples, and a reprex illustrating the problem (using #277), are below. This might well be out of scope.
Yeah, I just re-looked at #471 — it seems a bit too risky to me; I'd prefer to make the minimum change to make this work. But I'm still coming up to speed with dbplyr, so I'll have a better idea in a few days.