Modify fct_model_directories
model to handle staging model dependent on multiple sources
#525
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a:
Link to Issue
Closes #111
Description & motivation
Description from the Issue: In
fct_model_directories
we're specifying staging_models that have an incorrect file path based on their upstream source dependencies. However, if a staging model is dependent on multiple sources (against our best practices, and will cause a warning for other checks in this package, but alas it could still happen) then there will be multiple records for the staging model potentially indicating multiple different values forchange_file_path_to
. This means that you may be unable to resolve the warnings from this check in the case where your staging model depends on 2 different sources (defined in 2 different directories).I added a CTE to count number of sources in a staging model, and then
listagg()
them into a singlechange_file_path_to
column explaining the user should split into two staging models in their appropriate folders..I haven't added any scenarios to the integration tests yet, which is why I have put this PR into draft mode for now.
I haven't yet updated the documentation for
fct_model_directories
, but that is something I can do before requesting final review of the PR.Integration Test Screenshot
Not available yet.
Checklist