-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,8 @@ dbt-metabase models \ | |
--metabase-url https://metabase.example.com \ | ||
--metabase-username [email protected] \ | ||
--metabase-password Password123 \ | ||
--metabase-database business | ||
--metabase-database business \ | ||
--include-schemas public | ||
``` | ||
|
||
Open Metabase and go to Settings > Admin Settings > Table Metadata, you will notice that `id` column in `stg_users` is now marked as "Entity Key" and `group_id` is a "Foreign Key" pointing to `id` in `stg_groups`. | ||
|
@@ -209,7 +210,8 @@ dbt-metabase exposures \ | |
--metabase-url https://metabase.example.com \ | ||
--metabase-username [email protected] \ | ||
--metabase-password Password123 \ | ||
--output-path models/ | ||
--output-path models/ \ | ||
--exclude-collections temporary | ||
``` | ||
|
||
Once the execution completes, check your output path for exposures files containing descriptions, creator details and links for Metabase questions and dashboards: | ||
|
@@ -274,7 +276,7 @@ Note that common configurations are in the outer block and command-specific ones | |
Alternatively, you can invoke dbt-metabase programmatically. Below is the equivalent of CLI examples: | ||
|
||
```python | ||
from dbtmetabase import DbtMetabase | ||
from dbtmetabase import DbtMetabase, Filter | ||
# Initializing instance | ||
c = DbtMetabase( | ||
|
@@ -285,10 +287,16 @@ c = DbtMetabase( | |
) | ||
# Exporting models | ||
c.export_models(metabase_database="business") | ||
c.export_models( | ||
metabase_database="business", | ||
schema_filter=Filter(include=["public"]), | ||
) | ||
# Extracting exposures | ||
c.extract_exposures(output_path=".") | ||
c.extract_exposures( | ||
output_path=".", | ||
collection_filter=Filter(exclude=["temporary"]), | ||
) | ||
``` | ||
|
||
See function header comments for information about other parameters. | ||
|