In dbt, when I add a well formatted .yml file to my project, I stop being able to run dbt or compile SQL until I delete the yaml file. Why?
Asked Answered
S

1

6

Thank you in advance for helping me in my journey! I am a dbt newb, doing the dbt fundamentals course. I am following the directions exactly.

Sequence of the issue:

  1. I created .sql files in my models folder and subfolders, compiled them, ran dbt, and they showed up in my Snowflake DW. No problem

  2. I added a .yml file to one of the sub folders enter image description here

  3. The issue happens when I click "save" to save the code to the .yml file - that the course provided here. (See compilation error in screenshot)

enter image description here

  1. When I click on Compilation Error, I get this (Refreshing the IDE does not help):

Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. 'version'

enter image description here

  1. At this point, I am not able to run any of the models, even those in other subfolders. For example enter image description here

  2. Also, those .sql files also have the same compilation error above.

  3. When I delete the .yml file, everything goes to normal and all the errors disappear.

  4. things I have tried:

  • Deleting all the contents of the yml file and hitting save --> the compilation error goes away
  • Changing indentation
  • Only leaving a single test instead of two
  • Creating the yml file in a different subfolder
  • Signing out of dbt and back in

Please help! thank you

Salim answered 19/7, 2021 at 11:38 Comment(0)
M
12

I think it may be this bug: https://github.com/dbt-labs/dbt/issues/3567

That's related to partial parsing, which is a dbt Core performance optimization used in the dbt Cloud IDE. We rebuilt partial parsing from the ground up in v0.20.0, and we'll be including fixes for bugs we uncover (including that one) in v0.20.1.

In the meantime, if you find yourself in an error state like the one above, you can trigger a full re-parse by deleting the file target/partial_parse.msgpack.

Millstream answered 19/7, 2021 at 21:29 Comment(4)
This totally resolved the problem. Thank you!Salim
@Salim If this answer resolved your problem (as you say it does), then please consider accepting it as the answer to your question, by clicking the checkmark to the left. (See What does it mean to accept an answer? for information) This will let others know the issue has been resolved.Bakke
Hi, I will. There is one additional thing you could include in the answer. The issue went away the other day when I deleted that partial_parse file. However, the file came back and I had to re-delete itSalim
It makes sense that the file came back! dbt uses that for partial parsing, which offers a speedier experience while running your project in development. If you run into a bug with partial parsing (as you did above), you can delete that file to trigger a full re-parse. The goal is for you to have development that's fast and bug-free :)Millstream

© 2022 - 2024 — McMap. All rights reserved.