In Kollar and Mori "Birational geometry of algebraic varieties" discrepancy is defined as following way.
Let X be a normal variety and $D = \sum_i a_i D_i$ be a $\mathbb{Q}$ divisor. Assume that $m(\mathrm{K}_X + D ) $ is a Cartier divisor for some integer $m >0$. Let $f \colon Y \rightarrow X$ be a birational morphism from the normal variety $Y$ and $E$ be the exceptional locus of $f$. Then there exist rational numbers $a(E_i,X,D)$ such that $m a(E_i ,X,D)$ is an integer and $ m(K_Y + f^{-1}_* D)$ is linearly equivalent to $f^{*}(K_X + D) + \sum_i ma(E_i,X,D)E_i $ where $E_i \subset E$ is an exceptional divisor for all $i$.
My question: Are the numbers $ma(E_i,X,D)$ independent of the choice of representative of the linear equivalence class of $K_Y$?
If there is no principal divisor $ \operatorname{div}h = \sum_k a_k D_k$, $h \in K(Y) $ satisfying $D_k \subset E = \operatorname{Ex}(f)$, the answer of above question is yes.
When $f \colon Y \rightarrow X$ is proper, I can show there is no principal divisor $ \operatorname{div}h = \sum_k a_k D_k$, $h \in K(Y) $ satisfying $D_k \subset E = \operatorname{Ex}(f)$ as follows:
By valuative criterion, every discrete valuation which has center at X has center at Y. Hence $\operatorname{div}h = 0$ as divisor on $X$.Then $h \in \mathcal{O}^{*}_X$. We have $h \in \mathcal{O}^{*}_Y$ by morphism $\mathcal{O}_X \rightarrow f_{*}\mathcal{O}_Y $.
Above proof does not work when $f$ is not proper. So I have trouble when $f$ is not proper.