-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix parsing error for projects using the new YAML format for snapshots #11362
base: main
Are you sure you want to change the base?
Fix parsing error for projects using the new YAML format for snapshots #11362
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11362 +/- ##
==========================================
- Coverage 88.92% 88.87% -0.05%
==========================================
Files 190 190
Lines 24197 24197
==========================================
- Hits 21517 21505 -12
- Misses 2680 2692 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Thank you for putting together this PR and laying out the potential approaches so clearly! This implementation looks great to me in terms of limiting the blast radius and mitigating the root cause. Let's put together a small test case, perhaps by extending the existing Would be great to get this contribution in quickly since it's affecting many people! Let me know if you want to take a stab at the test or I can take it over the finish line (keeping your changelog cred of course!) 🏁 |
Hey @MichelleArk thanks for picking this up! I've had a go at adding some tests - but totally happy for you to take this over as well if it's easier to get it through! While adding the tests, I did a bit more digging, and found that there were some KeyErrors in a call to ManifestLoader.safe_update_project_parser_files_partially - which were handled but in a way that resulted in short-circuiting and not updating all the files. I'm assuming these were unintentional and just a result of iteration, and are safe to handle in this manner. I'm just having a look now to see if I can update any unit tests to match the changes - but have pushed the changes first in case you've got any feedback. |
Added some tests in, although the conditions that trigger this issue are quite specific, so I ended up having to change the unit tests a bit more than I was expecting (including changing some parts I wasn't planning to change). Happy to take on any feedback around what I have modified if we want it in a better state before merging! |
Resolves #11164
Problem
See #11164 - dbt projects using the new YAML format for Snapshots fail to parse, due to the schema used during parsing having
raw_code = None
while this is required by schema validation to be a string.Solution
This manually sets
block.file.contents
to an empty string to allow validation to pass while parsing.Checklist