Skip to content

Commit

Permalink
Merge pull request #2431 from alf-mindshift/dev/octavius-catto
Browse files Browse the repository at this point in the history
Make it possible to hide macros in docs
  • Loading branch information
beckjake authored May 18, 2020
2 parents 4e2ec6b + e34439d commit 75dbb0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

### Features
- Added a `full_refresh` config item that overrides the behavior of the `--full-refresh` flag ([#1009](/~https://github.com/fishtown-analytics/dbt/issues/1009), [#2348](/~https://github.com/fishtown-analytics/dbt/pull/2348))
- Added a "docs" field to macros, with a "show" subfield to allow for hiding macros from the documentation site ([#2430](/~https://github.com/fishtown-analytics/dbt/issues/2430))
- Added intersection syntax for model selector ([#2167](/~https://github.com/fishtown-analytics/dbt/issues/2167), [#2417](/~https://github.com/fishtown-analytics/dbt/pull/2417))

Contributors:
- [@raalsky](/~https://github.com/Raalsky) ([#2417](/~https://github.com/fishtown-analytics/dbt/pull/2417))
- [@alf-mindshift](/~https://github.com/alf-mindshift) ([#2431](/~https://github.com/fishtown-analytics/dbt/pull/2431)

## dbt 0.17.0 (Release TBD)

Expand Down
2 changes: 2 additions & 0 deletions core/dbt/contracts/graph/parsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class ParsedMacro(UnparsedBaseNode, HasUniqueID):
depends_on: MacroDependsOn = field(default_factory=MacroDependsOn)
description: str = ''
meta: Dict[str, Any] = field(default_factory=dict)
docs: Docs = field(default_factory=Docs)
patch_path: Optional[str] = None
arguments: List[MacroArgument] = field(default_factory=list)

Expand All @@ -297,6 +298,7 @@ def patch(self, patch: ParsedMacroPatch):
self.patch_path: Optional[str] = patch.original_file_path
self.description = patch.description
self.meta = patch.meta
self.docs = patch.docs
self.arguments = patch.arguments
if dbt.flags.STRICT_MODE:
assert isinstance(self, JsonSchemaMixin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def _verify_generic_macro_structure(self, manifest):
'path', 'original_file_path', 'package_name',
'root_path', 'name', 'unique_id', 'tags', 'resource_type',
'depends_on', 'meta', 'description', 'patch_path', 'arguments',
'macro_sql',
'macro_sql', 'docs'
}
)
# Don't compare the sql, just make sure it exists
Expand All @@ -869,6 +869,7 @@ def _verify_generic_macro_structure(self, manifest):
'resource_type': 'macro',
'depends_on': {'macros': []},
'description': '',
'docs': {'show': True},
'patch_path': None,
'meta': {},
'arguments': [],
Expand Down Expand Up @@ -1689,6 +1690,7 @@ def expected_postgres_references_manifest(self, model_database=None):
'name': 'test_nothing',
'depends_on': {'macros': []},
'description': 'My custom test that I wrote that does nothing',
'docs': {'show': True},
'macro_sql': AnyStringWith('macro test_nothing'),
'original_file_path': self.dir('macros/dummy_test.sql'),
'path': self.dir('macros/dummy_test.sql'),
Expand Down
1 change: 1 addition & 0 deletions test/unit/test_contracts_graph_parsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ def _ok_dict(self):
'depends_on': {'macros': []},
'meta': {},
'description': 'my macro description',
'docs': {'show': True},
'arguments': [],
}

Expand Down

0 comments on commit 75dbb0b

Please sign in to comment.