Repository: dbt-labs/dbt-core

Issue:
[Stephen Girard] resource list shows sources as None
To be fixed for the 0.13.0 (Stephen Girard) release. An invocation of `dbt run` shows:

```
Found 162 models, 320 tests, 0 archives, 0 analyses, 236 macros, 2 operations, 4 seed files, 34 None
                                                                                                 ^
                                                                                                 |
```

We should also add an assert, as this should fail immediately in development (it's easy to miss!)


Discussion:

Resolving patch:
diff --git a/core/dbt/compilation.py b/core/dbt/compilation.py
--- a/core/dbt/compilation.py
+++ b/core/dbt/compilation.py
@@ -36,6 +36,7 @@ def print_compile_stats(stats):
         NodeType.Macro: 'macros',
         NodeType.Operation: 'operations',
         NodeType.Seed: 'seed files',
+        NodeType.Source: 'sources',
     }
 
     results = {k: 0 for k in names.keys()}


Test patch:
diff --git a/test/integration/024_custom_schema_test/models/view_3.sql b/test/integration/024_custom_schema_test/models/view_3.sql
--- a/test/integration/024_custom_schema_test/models/view_3.sql
+++ b/test/integration/024_custom_schema_test/models/view_3.sql
@@ -1,5 +1,5 @@
 
-{{ config(schema='test') }}
+{{ config(schema='test', materialized='table') }}
 
 
 with v1 as (
diff --git a/test/integration/024_custom_schema_test/test_custom_schema.py b/test/integration/024_custom_schema_test/test_custom_schema.py
--- a/test/integration/024_custom_schema_test/test_custom_schema.py
+++ b/test/integration/024_custom_schema_test/test_custom_schema.py
@@ -1,5 +1,5 @@
 from nose.plugins.attrib import attr
-from test.integration.base import DBTIntegrationTest
+from test.integration.base import DBTIntegrationTest, use_profile
 
 
 class TestCustomSchema(DBTIntegrationTest):
@@ -85,6 +85,42 @@ def test__postgres__custom_schema_with_prefix(self):
         self.assertTablesEqual("agg","view_3", schema, xf_schema)
 
 
+class TestCustomProjectSchemaWithPrefixSnowflake(DBTIntegrationTest):
+
+    @property
+    def schema(self):
+        return "custom_schema_024"
+
+    @property
+    def models(self):
+        return "test/integration/024_custom_schema_test/models"
+
+    @property
+    def project_config(self):
+        return {
+            "models": {
+                "schema": "dbt_test"
+            }
+        }
+
+    @use_profile('snowflake')
+    def test__snowflake__custom_schema_with_prefix(self):
+        self.use_default_project()
+        self.run_sql_file("test/integration/024_custom_schema_test/seed.sql")
+
+        results = self.run_dbt()
+        self.assertEqual(len(results), 3)
+
+        schema = self.unique_schema().upper()
+        v1_schema = "{}_DBT_TEST".format(schema)
+        v2_schema = "{}_CUSTOM".format(schema)
+        xf_schema = "{}_TEST".format(schema)
+
+        self.assertTablesEqual("SEED","VIEW_1", schema, v1_schema)
+        self.assertTablesEqual("SEED","VIEW_2", schema, v2_schema)
+        self.assertTablesEqual("AGG","VIEW_3", schema, xf_schema)
+
+
 class TestCustomSchemaWithCustomMacro(DBTIntegrationTest):
 
     @property
diff --git a/test/unit/test_snowflake_adapter.py b/test/unit/test_snowflake_adapter.py
--- a/test/unit/test_snowflake_adapter.py
+++ b/test/unit/test_snowflake_adapter.py
@@ -125,7 +125,7 @@ def test_quoting_on_rename(self):
         )
         self.mock_execute.assert_has_calls([
             mock.call(
-                'alter table "test_database"."test_schema".table_a rename to table_b',
+                'alter table "test_database"."test_schema".table_a rename to "test_database"."test_schema".table_b',
                 None
             )
         ])