Plotting Sample_Posterior_Predictive output with Arviz

Hi, thanks for your response, I have tried the following as you suggested:

with model:
        idata = pm.sample(num_samples, cores=1)
        posterior = pm.sample_posterior_predictive(idata, extend_inferencedata=True)
        az.plot_ppc(posterior)

Unfortunately I still get the error KeyError: 0 thrown from the az.plot_ppc method.