A cool thing you can do here is actually check with arguments the `MetaData` 
constructor accepts, using the `inspect` standard library module:

```python
>>> from sqlalchemy import MetaData
>>> import inspect
>>> inspect.getargspec(MetaData)
ArgSpec(args=['self', 'bind', 'reflect', 'schema', 'quote_schema', 
'naming_convention', 'info'], varargs=None, keywords=None, defaults=(None, 
False, None, None, immutabledict({'ix': 'ix_%(column_0_label)s'}), None))
```

This way you can check if any of the keys in `extra['metadata_params']` is not 
in the `args` of the `ArgSpec`, and print an error message saying "The key 
'foo' is not valid!".

Note that even if we do this we should still keep the `try/except` block, since 
even if the keys are valid the values could be wrong.

[ Full content available at: 
https://github.com/apache/incubator-superset/pull/6004 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to