-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix partial parsing behaviour when model name contains dots #11455
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
base: main
Are you sure you want to change the base?
fix partial parsing behaviour when model name contains dots #11455
Conversation
…mes with dots / periods
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11455 +/- ##
==========================================
- Coverage 88.90% 88.84% -0.06%
==========================================
Files 194 194
Lines 24509 24514 +5
==========================================
- Hits 21789 21779 -10
- Misses 2720 2735 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yakovlevvs Thanks again for opening this PR!
There are a few failing tests:
pytest tests/functional/partial_parsing/test_versioned_models.py::TestVersionedModels::test_pp_versioned_models
pytest tests/functional/defer_state/test_modified_state.py::TestModifiedLatestVersion::test_changed_access
pytest tests/functional/unit_testing/test_ut_versions.py::TestVersions::test_versions
If you define a versioned model and examine the target/manifest.json
, you'll see why -- versioned models have at least 3 dot separators (more if the model name contains dots):
"model.my_project.my_model.v2": {
"database": "db",
"schema": "dev",
"name": "my_model",
"resource_type": "model",
"package_name": "my_project",
"path": "my_model_v2.sql",
"original_file_path": "models/my_model_v2.sql",
"unique_id": "model.my_project.my_model.v2",
So the assumption that there's a max of 2 dots doesn't hold.
Quite the puzzle to try to figure out how to handle all of these cases! Do you have any ideas?
@yakovlevvs Here's (3) simple project files for versioned models that you can use for local testing:
select 1 as id
select 1 as id
models:
- name: my_model
latest_version: 1
versions:
- v: 1
- v: 2 |
Hello @dbeatty10 yes, I've also noticed that from tests. Unfortunately it is not easy to say if the id of patched_node contains version of the model or not.
I will test this idea locally and if it works, I will fix it in new commit a bit later |
Hello @dbeatty10 i've pushed a new commit. With this fix all tests pass for me locally. I've also tested this on my enterprise's schema - partial parsing works fine for both versioned and unversioned models with and without dots. Could you please trigger the tests again? |
Hello @dbeatty10 it seems like all unit and functional tests passed successfully but "Validate Additional Reviews" is stuck forever. Is there anything I can do about this or should I just wait for the review? |
Resolves #11363
Problem
When model name contains dots, partial parsing fails with
dbt found two schema.yml entries for the same resource named
error.Solution
Fixed a function which causes incorrect manifest parsing for this case.
Checklist