I have confirmed this PR is not in the current version. My guess is it was added into the (short-lived 21.12 release which had issues so is being slowly re-incorporated into a more stable baseline of v23/v24 now.
We are also reviewing community-supplied PRs right now, and there is great stuff in there. If you are willing to merge feat(Query): Add random keyword in DQL by Samyak2 · Pull Request #7693 · dgraph-io/dgraph · GitHub into the current v23 release tag and test it to be sure it works, that would be most helpful.
You could of course also run that custom version of dgraph. Building dgraph is quite trivial and easy to work on.
In the meantime, you could add a lambda or client-side logic to pull all UIDs, select random ones, and use that.