Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use get_columns_name_id as a non-superuser #31

Closed
jasjuang opened this issue Mar 31, 2022 · 4 comments
Closed

Unable to use get_columns_name_id as a non-superuser #31

jasjuang opened this issue Mar 31, 2022 · 4 comments

Comments

@jasjuang
Copy link

In the get_columns_name_id function, it checks friendly_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 the friendly_names_is_disabled function, it does a self.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 though Friendly Table and Field Names is already set to disable by the Admin, a non superuser is still unable to use the get_columns_name_id function because self.get('/api/setting') returns False for a non superuser. Is it possible to consider the scenarios for a non superuser?

@vvaezian
Copy link
Owner

Hi @jasjuang , thanks for the feedback. I'll look into this on the weekend.

vvaezian added a commit that referenced this issue Apr 6, 2022
@vvaezian
Copy link
Owner

vvaezian commented Apr 7, 2022

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 vvaezian closed this as completed Apr 7, 2022
@jasjuang
Copy link
Author

jasjuang commented Apr 7, 2022

@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.

@vvaezian
Copy link
Owner

vvaezian commented Apr 7, 2022

@jasjuang There was an issue in the setup file. Please upgrade to 0.2.14.2 (latest version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants