I think you need a copy not to modify the original cube
```python
defn = copy.deepcopy(cube.metadata)
defn.attributes.pop('history', None)
```