also 'key' isn't defined so maybe make it a string or do:

```python
return dict(key=[value for key, value in items if value is not None])
```