diff --git a/core/dbt/artifacts/resources/v1/source_definition.py b/core/dbt/artifacts/resources/v1/source_definition.py index e09095fa0af..d12de028dc0 100644 --- a/core/dbt/artifacts/resources/v1/source_definition.py +++ b/core/dbt/artifacts/resources/v1/source_definition.py @@ -74,3 +74,4 @@ class SourceDefinition(ParsedSourceMandatory): created_at: float = field(default_factory=lambda: time.time()) unrendered_database: Optional[str] = None unrendered_schema: Optional[str] = None + doc_blocks: List[List[str]] = field(default_factory=list) diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index e941bcdfd62..767cc6e9267 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -1714,17 +1714,17 @@ def _process_docs_for_source( context: Dict[str, Any], source: SourceDefinition, ): - table_description = source.description - source_description = source.source_description - table_description = get_rendered(table_description, context) - source_description = get_rendered(source_description, context) - source.description = table_description - source.source_description = source_description + source.description, source.doc_blocks = _get_description_and_doc_blocks( + source.description, context + ) + source.source_description, source.doc_blocks = _get_description_and_doc_blocks( + source.source_description, context + ) for column in source.columns.values(): - column_desc = column.description - column_desc = get_rendered(column_desc, context) - column.description = column_desc + column.description, column.doc_blocks = _get_description_and_doc_blocks( + column.description, context + ) # macro argument descriptions diff --git a/schemas/dbt/manifest/v12.json b/schemas/dbt/manifest/v12.json index 987a94355ab..55a822c32e1 100644 --- a/schemas/dbt/manifest/v12.json +++ b/schemas/dbt/manifest/v12.json @@ -8426,6 +8426,15 @@ } ], "default": null + }, + "doc_blocks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } } }, "additionalProperties": false, @@ -18431,6 +18440,15 @@ } ], "default": null + }, + "doc_blocks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } } }, "additionalProperties": false, diff --git a/tests/functional/artifacts/expected_manifest.py b/tests/functional/artifacts/expected_manifest.py index 06478e0cc1d..31fb129c379 100644 --- a/tests/functional/artifacts/expected_manifest.py +++ b/tests/functional/artifacts/expected_manifest.py @@ -1319,7 +1319,7 @@ def expected_references_manifest(project): "tags": [], "constraints": [], "granularity": None, - "doc_blocks": [], + "doc_blocks": [["doc", "column_info"]], } }, "config": {