Skip to content

Commit

Permalink
Add description attribute to SelectorDefinition [#2800]
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Nov 2, 2020
1 parent 4e19e87 commit bfc9707
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/dbt/contracts/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class SelectorDefinition(JsonSchemaMixin):
name: str
definition: Union[str, Dict[str, Any]]
description: str = ''


@dataclass
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_graph_selector_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ def test_parse_simple():
sf = parse_file('''\
selectors:
- name: tagged_foo
description: Selector for foo-tagged models
definition:
tag: foo
''')

assert len(sf.selectors) == 1
assert sf.selectors[0].description == 'Selector for foo-tagged models'
parsed = cli.parse_from_selectors_definition(sf)
assert len(parsed) == 1
assert 'tagged_foo' in parsed
Expand Down

0 comments on commit bfc9707

Please sign in to comment.