Repository: dbt-labs/dbt-core

Issue:
Fix Experimental Parser So Tests Pass
### Describe the bug
Running the postgres integration suite with the experimental parser always on results in a failure. 

### Steps To Reproduce
Run the following with the line `flags.USE_EXPERIMENTAL_PARSER = True` in `models.py::render_update`:
```
python3 -m pytest test/integration/039_config_test/test_configs.py::TestConfigs::test_postgres_config_layering
```

You get the following failure:
```
dbt.exceptions.CompilationException: Compilation Error
E         The selection criterion 'tag:tag_two' does not match any nodes
```

### Expected behavior
This test seems to be reasonable so we expect it to pass.

### Additional context
If a release goes out with this problem it will cause the tracking to have an outsized proportion of mismatches rendering the tracking for that version fairly useless.



Discussion:

Resolving patch:
diff --git a/core/dbt/parser/models.py b/core/dbt/parser/models.py
--- a/core/dbt/parser/models.py
+++ b/core/dbt/parser/models.py
@@ -130,11 +130,12 @@ def render_update(
             # values from yaml files are in there already
             node.unrendered_config.update(dict(experimentally_parsed['configs']))
 
-            # set refs, sources, and configs on the node object
+            # set refs and sources on the node object
             node.refs += experimentally_parsed['refs']
             node.sources += experimentally_parsed['sources']
-            for configv in experimentally_parsed['configs']:
-                node.config[configv[0]] = configv[1]
+
+            # configs don't need to be merged into the node
+            # setting them in config._config_call_dict is sufficient
 
             self.manifest._parsing_info.static_analysis_parsed_path_count += 1
 
diff --git a/core/setup.py b/core/setup.py
--- a/core/setup.py
+++ b/core/setup.py
@@ -63,7 +63,7 @@ def read(fname):
         'networkx>=2.3,<3',
         'packaging~=20.9',
         'sqlparse>=0.2.3,<0.4',
-        'dbt-extractor==0.2.0',
+        'dbt-extractor==0.4.0',
         'typing-extensions>=3.7.4,<3.11',
         'werkzeug>=1,<3',
         # the following are all to match snowflake-connector-python


Test patch:
diff --git a/test/integration/072_experimental_parser_tests/models/model_a.sql b/test/integration/072_experimental_parser_tests/models/model_a.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/072_experimental_parser_tests/models/model_a.sql
@@ -0,0 +1,6 @@
+{{ config(tags='hello', x=False) }}
+{{ config(tags='world', x=True) }}
+
+select * from {{ ref('model_a') }}
+cross join {{ source('my_src', 'my_tbl') }}
+where false as boop
diff --git a/test/integration/072_experimental_parser_tests/models/schema.yml b/test/integration/072_experimental_parser_tests/models/schema.yml
new file mode 100644
--- /dev/null
+++ b/test/integration/072_experimental_parser_tests/models/schema.yml
@@ -0,0 +1,12 @@
+version: 2
+
+sources:
+  - name: my_src
+    schema: "{{ target.schema }}"
+    tables:
+      - name: my_tbl
+
+models:
+  - name: model_a
+    columns:
+      - name: fun
diff --git a/test/integration/072_experimental_parser_tests/test_all_experimental_parser.py b/test/integration/072_experimental_parser_tests/test_all_experimental_parser.py
new file mode 100644
--- /dev/null
+++ b/test/integration/072_experimental_parser_tests/test_all_experimental_parser.py
@@ -0,0 +1,35 @@
+from dbt.contracts.graph.manifest import Manifest
+import os
+from test.integration.base import DBTIntegrationTest, use_profile
+
+
+def get_manifest():
+    path = './target/partial_parse.msgpack'
+    if os.path.exists(path):
+        with open(path, 'rb') as fp:
+            manifest_mp = fp.read()
+        manifest: Manifest = Manifest.from_msgpack(manifest_mp)
+        return manifest
+    else:
+        return None
+
+
+class TestAllExperimentalParser(DBTIntegrationTest):
+    @property
+    def schema(self):
+        return "072_experimental_parser"
+
+    @property
+    def models(self):
+        return "models"
+
+    @use_profile('postgres')
+    def test_postgres_experimental_parser(self):
+        results = self.run_dbt(['--use-experimental-parser', 'parse'])
+        manifest = get_manifest()
+        node = manifest.nodes['model.test.model_a']
+        self.assertEqual(node.refs, [['model_a']])
+        self.assertEqual(node.sources, [['my_src', 'my_tbl']])
+        self.assertEqual(node.config._extra, {'x': True})
+        self.assertEqual(node.config.tags, ['hello', 'world'])
+        
\ No newline at end of file