gouline / dbt-metabase

dbt + Metabase integration
https://pypi.org/project/dbt-metabase/
MIT License
442 stars 63 forks source link

Exposures command fails with deactivated users #90

Closed KenxinKun closed 2 years ago

KenxinKun commented 2 years ago

When running the dbt-metabase exposures command it fails when it hits an item referencing a deactivated user. In particular, this line returns 404, causing the whole script to crash:

https://github.com/gouline/dbt-metabase/blob/7d8c97ef46b2da7d4655280562c581d2659c9b79/dbtmetabase/metabase.py#L596

Possible solutions: 1) try-catch this block and fill-in the details with a generic anonymous user 2) use instead the /api/user?include_deactivated=true endpoint to list all users once and search by ID. This endpoint has the advantage of also retrieving deactivated user's details, whilst the /api/user/:id one returns 404.

KenxinKun commented 2 years ago

Duplicate of #88