The partial copula provides a method for describing the dependence between two real valued random variables X and Y conditional on a third random vector Z in terms of nonparametric residuals. These residuals are in practice computed via models of the conditional distributions X|Z and Y|Z. In this talk I will show how the nonparametric residuals can be combined to give a valid test of conditional independence provided that nonparametric estimators of the conditional distributions converge at a sufficient rate. The rates can be realized via estimators based on quantile regression. If time permits, I will show how the test can be generalized to conditional local independence (Granger noncausality) in a time dynamic framework.