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

Make it possible to hide macros in docs #2431

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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