Fix stack overflow with mappings to cyclic datamodels

3 jobs for master in 8 minutes and 43 seconds (queued for 2 seconds)