Closed jasjuang closed 2 years ago
Hi @jasjuang , thanks for the feedback. I'll look into this on the weekend.
Fixed in version 0.2.14.1
You need to pass is_admin=False
:
from metabase_api import Metabase_API
mb = Metabase_API('https://...', 'username', 'password', is_admin=False)
@vvaezian did something went wrong with the pip deployment for 0.2.14.1? After the upgrade, from metabase_api import Metabase_API
shows ModuleNotFoundError: No module named 'metabase_api'
. But if I drop it back to pip install metabase-api==0.2.14
everything is back to normal.
@jasjuang There was an issue in the setup file. Please upgrade to 0.2.14.2 (latest version)
In the
get_columns_name_id
function, it checksfriendly_names_is_disabled
first before allowing us to use the function as seen in https://github.com/vvaezian/metabase_api_python/blob/master/metabase_api/metabase_api.py#L339. However, in thefriendly_names_is_disabled
function, it does aself.get('/api/setting')
as seen in https://github.com/vvaezian/metabase_api_python/blob/master/metabase_api/metabase_api.py#L372. This is causing a problem because according to https://github.com/metabase/metabase/blob/master/docs/api-documentation.md#setting,GET /api/setting/
is only available to superuser, so even thoughFriendly Table and Field Names
is already set to disable by the Admin, a non superuser is still unable to use theget_columns_name_id
function becauseself.get('/api/setting')
returnsFalse
for a non superuser. Is it possible to consider the scenarios for a non superuser?