Minor: a more python way might be:
```
params = {'namespace': namespace} if namespace else {}
```