There’s likely a processing step involved with observed that automatically casts the data or manages its type before the type of error you’ve seen can come up. Can you work around this by doing Site_obs = pm.Data("Site_obs", X_train["Site_Code"].astype('int32')?