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 compiled_sql from manifest (no injected_sql, no run_results) #148

Merged
merged 4 commits into from
Oct 19, 2020
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
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
## dbt 0.19.0 (Release TBD)
- Add select/deselect option in DAG view dropups. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98))
- Fixed issue where sources with tags were not showing up in graph viz ([docs#93](https://github.com/fishtown-analytics/dbt-docs/issues/93))
- Add select/deselect option in DAG view dropups. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98), [docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138))
- Fixed issue where sources with tags were not showing up in graph viz ([docs#93](https://github.com/fishtown-analytics/dbt-docs/issues/93), [docs#139](https://github.com/fishtown-analytics/dbt-docs/pull/139))
- Use `compiled_sql` instead of `injected_sql` for "Compiled" ([docs#146](https://github.com/fishtown-analytics/dbt-docs/issues/146), [docs#148](https://github.com/fishtown-analytics/dbt-docs/issues/148))

Contributors:
- [@Mr-Nobody99](https://github.com/Mr-Nobody99) ([docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138))
- [@jplynch77](https://github.com/jplynch77) ([docs#139](https://github.com/fishtown-analytics/dbt-docs/pull/139))

## dbt 0.18.1 (Unreleased)
## dbt 0.18.1 (October 13, 2020)
- Add Exposure nodes ([docs#135](https://github.com/fishtown-analytics/dbt-docs/issues/135), [docs#136](https://github.com/fishtown-analytics/dbt-docs/pull/136), [docs#137](https://github.com/fishtown-analytics/dbt-docs/pull/137))

## dbt 0.18.0 (September 2, 2020)
Expand Down
11 changes: 8 additions & 3 deletions ci-project/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

name: 'jaffle_shop'
version: '0.1'
config-version: 2
profile: 'jaffle_shop'
source-paths: ["models"]
analysis-paths: ["analysis"]
Expand All @@ -16,7 +17,11 @@ clean-targets:

models:
jaffle_shop:
materialized: table
+materialized: table
marts:
core:
intermediate:
+materialized: ephemeral
staging:
materialized: view
tags: ["staging", "hourly"]
+materialized: view
+tags: ["staging", "hourly"]
2 changes: 1 addition & 1 deletion data/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/app/docs/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ angular

$scope.versions = {
'Source': $scope.model.raw_sql,
'Compiled': $scope.model.injected_sql
'Compiled': $scope.model.compiled_sql
}
})
}]);
2 changes: 1 addition & 1 deletion src/app/docs/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ angular
var default_compiled = '\n-- compiled SQL not found for this model\n';
$scope.versions = {
'Source': $scope.model.raw_sql,
'Compiled': $scope.model.injected_sql || default_compiled
'Compiled': $scope.model.compiled_sql || default_compiled
}

setTimeout(function() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/docs/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angular
var default_compiled = "Compiled SQL is not available for this snapshot";
$scope.versions = {
'Source': $scope.model.raw_sql,
'Compiled': $scope.model.injected_sql || default_compiled
'Compiled': $scope.model.compiled_sql || default_compiled
}

setTimeout(function() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/docs/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angular
var default_compiled = '\n-- compiled SQL not found for this model\n';
$scope.versions = {
'Source': $scope.model.raw_sql,
'Compiled': $scope.model.injected_sql || default_compiled
'Compiled': $scope.model.compiled_sql || default_compiled
}

setTimeout(function() {
Expand Down
31 changes: 3 additions & 28 deletions src/app/services/project_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ angular
files: {
manifest: {},
catalog: {},
run_results: {},
},
loaded: $q.defer(),
}
Expand Down Expand Up @@ -83,29 +82,6 @@ angular
return merge(catalog, manifest)
}

function incorporate_run_results(project, run_results) {
if (!run_results) {
return project;
}

_.each(run_results.results, function(result) {
var node = result.node;

if (!node) {
return
}

var unique_id = node.unique_id;
var injected_sql = node.injected_sql;

if (project.nodes[unique_id]) {
project.nodes[unique_id].injected_sql = node.injected_sql;
}
});

return project
}

function loadFile(label, path) {
return $http({
method: 'GET',
Expand Down Expand Up @@ -166,13 +142,12 @@ angular
service.files.manifest.macros = macros;

var project = incorporate_catalog(service.files.manifest, service.files.catalog);
var compiled_project = incorporate_run_results(project, service.files.run_results);


var models = compiled_project.nodes
var models = project.nodes
var model_names = _.keyBy(models, 'name');

var tests = _.filter(compiled_project.nodes, {resource_type: 'test'})
var tests = _.filter(project.nodes, {resource_type: 'test'})
_.each(tests, function(test) {

if (test.tags.indexOf('schema') == -1) {
Expand Down Expand Up @@ -236,7 +211,7 @@ angular
}
});

service.project = compiled_project;
service.project = project;

// performance hack
var search_macros = _.filter(service.project.macros, function(macro) {
Expand Down