You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When we parse a model node, any configs set in the schema yaml file do not get incorporated until after the fact.
Specifically all nodes are considered enabled (if only disabled in the schema yaml file) while we parse through the sql files until we parse the schema file. So they end up as nodes in the manifest to be processed and are not in the disabled dict.
Specifically the value of node.config.enabled will always be True when the node was set to disabled only in the yaml file. It will probably be incorrectly set to False if it is set to False at the project level and overridden at the yaml level to be True.
github-actionsbot
changed the title
[Bug] Schema Files not parsed for models
[CT-1197] [Bug] Schema Files not parsed for models
Sep 16, 2022
emmyoop
changed the title
[CT-1197] [Bug] Schema Files not parsed for models
[CT-1197] [Bug] Schema Files not parsed for models in time
Sep 16, 2022
emmyoop
changed the title
[CT-1197] [Bug] Schema Files not parsed for models in time
[CT-1197] [Bug] Schema Files not parsed for models at the right time
Sep 16, 2022
The fundamental issue in the parsing order that you've identified here feels related to #4000 as well. We instantiate snapshot nodes after parsing the .sql file, perform dataclass validation, check for specific configs, if they're not supplied we raise an error, before actually parsing the .yml file that might contain those configs.
leahwicz
added
the
tech_debt
Behind-the-scenes changes, with little direct impact on end-user functionality
label
Sep 22, 2022
This really comes down to the order we have to process the files. "Fixing" this really means reworking parsing order, possibly saving files to parse over again? Not sure if it would really decrease complexity because we re-process the files.
Is this a new bug in dbt-core?
Current Behavior
When we parse a model node, any configs set in the schema yaml file do not get incorporated until after the fact.
Specifically all nodes are considered enabled (if only disabled in the schema yaml file) while we parse through the sql files until we parse the schema file. So they end up as nodes in the manifest to be processed and are not in the disabled dict.
Specifically the value of
node.config.enabled
will always beTrue
when the node was set to disabled only in the yaml file. It will probably be incorrectly set toFalse
if it is set toFalse
at the project level and overridden at the yaml level to beTrue
.dbt-core/core/dbt/parser/base.py
Lines 370 to 374 in f5a94fc
There is also a bit of hacky logic as follows to ensure we don't resolve refs on disabled nodes even though the node is in the manifest.
TODO: add link to
process_refs
inparser/manifest.py
after #5868 gets mergedThe above conditional should be removed when this gets resolved since we would no longer be resolving refs for disabled nodes.
Expected Behavior
Account for configs set in schema files.
Steps To Reproduce
A barebones project with 3 models:
A schema.yml like so:
run
dbt run
and examinemanifest.nodes
andmanifest.disabled
Additional Context
#5868 fixed the bugs users are experiencing, this is to fix the underlying issue
The text was updated successfully, but these errors were encountered: