From fca67630a71b75a5fa4c944c296e9ed6c61b4009 Mon Sep 17 00:00:00 2001 From: Alex Roy Date: Thu, 14 Mar 2024 21:43:36 -0400 Subject: [PATCH] revert flag name now that we have alignment --- dbtmetabase/__main__.py | 10 +++++----- dbtmetabase/_exposures.py | 6 +++--- tests/fixtures/api/dashboard/1.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbtmetabase/__main__.py b/dbtmetabase/__main__.py index aa506fe..779c5c5 100644 --- a/dbtmetabase/__main__.py +++ b/dbtmetabase/__main__.py @@ -360,11 +360,11 @@ def models( help="Include personal Metabase collections.", ) @click.option( - "--exclude-unverified-cards", - envvar="EXCLUDE_UNVERIFIED_CARDS", + "--exclude-unverified", + envvar="EXCLUDE_UNVERIFIED", show_envvar=True, is_flag=True, - help="Exclude cards that have not been verified.", + help="Exclude items that have not been verified. Only applies to entity types that support verification.", ) def exposures( output_path: str, @@ -372,7 +372,7 @@ def exposures( include_collections: Optional[Sequence[str]], exclude_collections: Optional[Sequence[str]], allow_personal_collections: bool, - exclude_unverified_cards: bool, + exclude_unverified: bool, core: DbtMetabase, ): core.extract_exposures( @@ -383,7 +383,7 @@ def exposures( exclude=exclude_collections, ), allow_personal_collections=allow_personal_collections, - exclude_unverified_cards=exclude_unverified_cards, + exclude_unverified=exclude_unverified, ) diff --git a/dbtmetabase/_exposures.py b/dbtmetabase/_exposures.py index 25b2d5a..b4cac4c 100644 --- a/dbtmetabase/_exposures.py +++ b/dbtmetabase/_exposures.py @@ -46,7 +46,7 @@ def extract_exposures( output_grouping: Optional[str] = None, collection_filter: Optional[Filter] = None, allow_personal_collections: bool = False, - exclude_unverified_cards: bool = False, + exclude_unverified: bool = False, ) -> Iterable[Mapping]: """Extract dbt exposures from Metabase. @@ -55,7 +55,7 @@ def extract_exposures( output_grouping (Optional[str], optional): Grouping for output YAML files, supported values: "collection" (by collection slug) or "type" (by entity type). Defaults to None. collection_filter (Optional[Filter], optional): Filter Metabase collections. Defaults to None. allow_personal_collections (bool, optional): Allow personal Metabase collections. Defaults to False. - exclude_unverified_cards (bool, optional): Exclude unverified cards. Defaults to False. + exclude_unverified (bool, optional): Exclude items that have not been verified. Only applies to entity types that support verification. Defaults to False. Returns: Iterable[Mapping]: List of parsed exposures. @@ -92,7 +92,7 @@ def extract_exposures( models=("card", "dashboard"), ): if ( - exclude_unverified_cards + exclude_unverified and item["model"] == "card" and item.get("moderated_status") != "verified" ): diff --git a/tests/fixtures/api/dashboard/1.json b/tests/fixtures/api/dashboard/1.json index 38c75de..7fd847a 100644 --- a/tests/fixtures/api/dashboard/1.json +++ b/tests/fixtures/api/dashboard/1.json @@ -12,7 +12,7 @@ }, "updated_at": "2021-07-21T08:01:37.372373Z", "col": 0, - "id": 1, + "id": 100, "parameter_mappings": [], "card_id": null, "visualization_settings": {