Suppose that $X$,$Y$, and $Y'$ are independent and identically distributed random variables defined on some probability space $(\Omega,\mathcal F,P)$. Assume that $f:\mathbb R^2\to\mathbb R$ is a measurable function so that $$ f(X,Y) $$ is a random variable. Consider the conditional expectation $$ \operatorname E[f(X,Y)\mid\sigma(X)], $$ where $\sigma(X)$ is the $\sigma$-algebra generated by $X$.
Is it true that $$\operatorname E[f(X,Y)\mid\sigma(X)]=\operatorname E[f(X,Y')\mid\sigma(X)]$$ almost surely? In other words, does the replacement of $Y$ with an independent and identically distributed copy $Y'$ change the conditional expectation? If it does not, how can we make sure that the conditional expectation remains unchanged?
Since the conditional expectation is with respect to the $\sigma$-algebra generated only by $X$, it seems that it should indeed be the case. Roughly speaking, the conditional expectation only depends on $X$ and we change $Y$ with an independent and identically distributed copy $Y'$. But I am trying to come up with some sort of a more rigorous argument.
Any help is much appreciated!