Repository: dbt-labs/dbt-core

Issue:
Partial parsing: Parsing disabled models crashes dbt
### Describe the bug

I ran `dbt seed` (and have partial parsing configured for my user). dbt crashed with a KeyError on a disabled node while rebuilding the manifest from the parse cache.


### Steps To Reproduce
create a `dbt_project.yml` like this, disabling a seed:
```
name: 'minimal'
version: '1.0.0'
seeds:
  minimal:
    source:
        enabled: False
````

Run `dbt compile` twice.

### Expected behavior
dbt should compile my project and say there are no enabled seeds.

### System information
**Which database are you using dbt with?**

Any/all this is a core issue

**The output of `dbt --version`:**
From current `dev/barbara-gittings` (b9f8dedc8)
 
**The operating system you're using:**
Any

**The output of `python --version`:**
Any

### Additional context

This is pretty straightforward to fix, I'm pretty sure.


Discussion:

Resolving patch:
diff --git a/core/dbt/parser/results.py b/core/dbt/parser/results.py
--- a/core/dbt/parser/results.py
+++ b/core/dbt/parser/results.py
@@ -106,7 +106,9 @@ def add_patch(self, source_file: SourceFile, patch: ParsedNodePatch):
         self.get_file(source_file).patches.append(patch.name)
 
     def _get_disabled(
-        self, unique_id: str, match_file: SourceFile
+        self,
+        unique_id: str,
+        match_file: SourceFile,
     ) -> List[ParsedNode]:
         if unique_id not in self.disabled:
             raise InternalException(
@@ -127,6 +129,9 @@ def _process_node(
     ) -> None:
         """Nodes are a special kind of complicated - there can be multiple
         with the same name, as long as all but one are disabled.
+
+        Only handle nodes where the matching node has the same resource type
+        as the current parser.
         """
         source_path = source_file.path.original_file_path
         found: bool = False
@@ -184,7 +189,9 @@ def sanitized_update(
         # the node ID could be in old_result.disabled AND in old_result.nodes.
         # In that case, we have to make sure the path also matches.
         for node_id in old_file.nodes:
-            if old_result.nodes[node_id].resource_type != resource_type:
+            # cheat: look at the first part of the node ID and compare it to
+            # the parser resource type. On a mismatch, bail out.
+            if resource_type != node_id.split('.')[0]:
                 continue
             self._process_node(node_id, source_file, old_file, old_result)
 


Test patch:
diff --git a/test/integration/039_config_test/test_configs.py b/test/integration/039_config_test/test_configs.py
--- a/test/integration/039_config_test/test_configs.py
+++ b/test/integration/039_config_test/test_configs.py
@@ -88,3 +88,32 @@ def test_postgres_alternative_target_paths(self):
         dirs = list(self.new_dirs())
         self.assertEqual(len(dirs), 1)
         self.assertTrue(os.path.exists(os.path.join(dirs[0], 'manifest.json')))
+
+
+class TestDisabledConfigs(DBTIntegrationTest):
+    @property
+    def schema(self):
+        return "config_039"
+
+    @property
+    def project_config(self):
+        return {
+            'data-paths': ['data'],
+            'seeds': {
+                'quote_columns': False,
+                'test': {
+                    'seed': {
+                        'enabled': False,
+                    }
+                }
+            },
+        }
+
+    @property
+    def models(self):
+        return "empty-models"
+
+    @use_profile('postgres')
+    def test_postgres_disable_seed_partial_parse(self):
+        self.run_dbt(['--partial-parse', 'seed'])
+        self.run_dbt(['--partial-parse', 'seed'])