-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Is this a new bug in dbt-core?
- I believe this is a new bug in dbt-core
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
Partial parsing raised an exception when it encounters a changed model with a singular test because singular tests do not have attached_node attributes. dbt then falls back to a full parse.
16:45:00 PP exception info: {'exception': "AttributeError: 'SingularTestNode' object has no attribute 'attached_node'", 'code': 'if child_test.attached_node:', 'parse_file_type': 'schema', 'traceback': 'Traceback (most recent call last):\n File "/home/dbtuser/.local/share/pipx/venvs/dbt-monzo/lib/python3.12/site-packages/dbt/parser/manifest.py", line 545, in safe_update_project_parser_files_partially\n project_parser_files = self.partial_parser.get_parsing_files()\n ...
Expected Behavior
Partial parsing does not error when it encounters this scenario.
Steps To Reproduce
- have a sql model with a yml resource file + a sql singular test that reference the model
- fully parse the project
- modify the model
- attempt to partially parse the project
- error occurs
Relevant log output
Environment
- OS: Debian
- Python: 3.12
- dbt: v1.10.14 and v1.10.15 (but not earlier versions inc v1.10.13)Which database adapter are you using with dbt?
bigquery
Additional Context
Appears to have been introduced by this backported change: #12060
The check here (https://github.com/dbt-labs/dbt-core/pull/12060/files#diff-2fd42940aaee0e200a257863155b747faf735f6b49ae49ac9229c17be33db82aR920) should be guarded with a check that the node is a GenericTest and not a SingularTest (all other instances of checking for attached_nodes in the codebase do this already).