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

Use column.comment from catalog/database if column.description is missing #263

Closed
Closed
Show file tree
Hide file tree
Changes from 2 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
@@ -1,9 +1,11 @@
## dbt-core 1.1.0 (TBD)
- Fixed capitalization in UI for exposures of `type: ml` ([#256](https://github.com/dbt-labs/dbt-docs/issues/256))
- List packages and tags in alphabetical order ([docs#235](https://github.com/dbt-labs/dbt-docs/pull/235))
- Display column description from database if description is missing from DBT config ([#128](https://github.com/dbt-labs/dbt-docs/issues/128))
halvorlu marked this conversation as resolved.
Show resolved Hide resolved

Contributors:
- [@pgoslatara](https://github.com/pgoslatara) ([docs#235](https://github.com/dbt-labs/dbt-docs/pull/235))
- [@halvorlu](https://github.com/halvorlu) ([docs#263](https://github.com/dbt-labs/dbt-docs/pull/263))

## dbt-core 1.0.4 (March 18th, 2022)

Expand Down
6 changes: 3 additions & 3 deletions src/app/components/column_details/column_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<span class='text-dark'>{{ column.type }}</p>
</td>
<td style="text-overflow: ellipsis; overflow-x: hidden; white-space: nowrap; max-width: 1px;">
<span ng-show="!column.expanded">{{ column.description }}</span>
<span ng-show="!column.expanded">{{ getMergedDescription(column) }}</span>
</td>
<td>
<span class="text-light" ng-show="!column.expanded">
Expand Down Expand Up @@ -71,9 +71,9 @@ <h5>Details</h5>
</div>
</div>

<div style="margin-bottom: 15px" ng-if="column.description.length">
<div style="margin-bottom: 15px" ng-if="getMergedDescription(column).length">
<h5>Description</h5>
<span marked="column.description"></span>
<span marked="getMergedDescription(column)"></span>
</div>

<div ng-show="column.tests && column.tests.length" style="margin-bottom: 15px">
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/column_details/column_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ angular

scope.has_more_info = function(column) {
var tests = (column.tests || []);
var description = (column.description || "");
var description = scope.getMergedDescription(column);
var meta = (column.meta || {});

return tests.length || description.length || !_.isEmpty(meta);
Expand All @@ -37,6 +37,11 @@ angular
return 'dbt.' + node.resource_type;
}

scope.getMergedDescription = function(column) {
// Prefer description from DBT config if present
return column.description || column.comment || "";
}

scope.get_col_name = function(col_name) {
return projectService.caseColumn(col_name);
}
Expand Down