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 using the this object to pass into a macro on the post_hook config the schema is correct and incorrect at different stages. Sometimes using the correct schema logic and sometimes defaulting just the schema provided in the profile
Expected Behavior
The this.schema always resolves to consistent logic or is none if schema is not available at a given stage.
Steps To Reproduce
Standard DBT starter project
Profile set up with a schema set "profile_schema"
{{
config(
materialized='table',
schema='test_schema',
post_hook= a_macro( this )
) }}
Added to models/example/my_first_dbt_model.sql
4. New macro added to macros/a_macro.sql
In console output logs
04:48:49 1 of 1 START sql table model profile_schema_test_schema.my_first_dbt_model ......... [RUN]
04:48:49 Source is: "dev"."profile_schema_test_schema"."my_first_dbt_model"
04:48:51 1 of 1 OK created sql table model profile_schema_test_schema.my_first_dbt_model .... [SUCCESS in 1.94s]
-------------------------
When looking at the logs to see what the posthook did run
select'"dev"."profile_schema"."my_first_dbt_model"';
Environment
- OS: wsl Ubuntu
- Python: 3.12
- dbt: 1.9.2
tested on snowflake and Redshift adapter
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Is this a new bug in dbt-core?
Current Behavior
When using the this object to pass into a macro on the post_hook config the schema is correct and incorrect at different stages. Sometimes using the correct schema logic and sometimes defaulting just the schema provided in the profile
Expected Behavior
The this.schema always resolves to consistent logic or is none if schema is not available at a given stage.
Steps To Reproduce
Added to models/example/my_first_dbt_model.sql
4. New macro added to macros/a_macro.sql
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: