Conditionally construct map

You can pattern match on Ecto.AssocNotLoaded and then have the map construction not include the key in that clause, or you can put nil and then have Enum.reject that deletes any map pairs with a nil value. Either one would be just fine.