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

[CT-2337] [Bug] [Partial parsing] Error in merge_patch when version: 2 missing from yaml file #7236

Closed
jtcohen6 opened this issue Mar 29, 2023 · 0 comments · Fixed by #7238
Closed
Assignees
Labels
bug Something isn't working partial_parsing

Comments

@jtcohen6
Copy link
Contributor

I think there might be a bug with partial parsing if a yaml ("schema") file is missing version: 2, per #7060!

models:
  - name: any_model
    description: My favorite model
-- models/any_model.sql
select 1 as id
$ dbt parse
00:32:51  Running with dbt=1.5.0-b4
00:32:51  Unable to do partial parsing because an error occurred. Switching to full reparse.
00:32:52  Performance info: target/perf_info.json

In logs/dbt.log:

PP exception info: {'code': '    schema_file.pp_dict = {"version": schema_file.dict_from_yaml["version"]}', 'parse_file_type': 'model', 'exception': "KeyError: 'version'", 'location': 'line 810 in merge_patch', 'traceback': 'Traceback (most recent call last):
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/manifest.py", line 293, in load
    project_parser_files = self.partial_parser.get_parsing_files()
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/partial.py", line 188, in get_parsing_files
    self.update_in_saved(file_id)
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/partial.py", line 288, in update_in_saved
    self.update_mssat_in_saved(new_source_file, old_source_file)
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/partial.py", line 316, in update_mssat_in_saved
    self.remove_node_in_saved(new_source_file, unique_id)
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/partial.py", line 350, in remove_node_in_saved
    self.merge_patch(schema_file, dict_key, elem_patch)
  File "/Users/jerco/dev/product/dbt-core/core/dbt/parser/partial.py", line 810, in merge_patch
    schema_file.pp_dict = {"version": schema_file.dict_from_yaml["version"]}
KeyError: \'version\'
'}
@github-actions github-actions bot changed the title [Bug] [Partial parsing] Error in merge_patch when version: 2 missing from yaml file [CT-2337] [Bug] [Partial parsing] Error in merge_patch when version: 2 missing from yaml file Mar 29, 2023
@gshank gshank self-assigned this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working partial_parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants