fixy. if metadata was not provided, set mapping dict to None.