The linkage function does not need the metric argument; it cancels the transmission of your original observations instead of the distance matrix .
From the published link
y: ndarray
[...] Alternatively, a collection of m observation vectors in n dimensions can be transmitted as an array m by n.
The linkage function checks if you passed a valid distance matrix, presumably using is_valid_y / is_valid_dm - and if not, it will first apply pdist with the metric you specify (and the Euclidean metric if nothing is specified).
source share