-
Notifications
You must be signed in to change notification settings - Fork 30
dbt 0.12 and custom schemas #7
Comments
cc @jthandy FYI I reconfigured our schema naming to get around this but may be impacting others |
oh christ. yeah, I actually did it this way originally because that feature didn't exist. I will try to get around to fixing this. Thanks for the heads up. |
I had a look at this today as it's relevant to a piece of client work that I'm doing. The tricky part about using the custom schema behavior is that we have to know which schema the audit table lives in.
If we instead use: But then, when we try to insert into this table from a model that is being created in another schema, it will use the schema for the current model, leading to errors like this:
I can't find a way to easily tell dbt to always the schema for the
but that resulted in:
So, is there a way to access |
@clrcrl what is the desired behavior here? Should all logs go into the same table? Or should a If we want everything to go into a single table, I think we might need to hack it like this:
This is a pretty big hack, but it's no worse than the existing hack :p |
Closing as I'm not actually sure what the bug is here. I tried to dig in a tiny bit, but didn't get anywhere: Steps to reproduce:
Expected results:
Actual results:
|
This package depends quite a bit on the default schema naming format (eg
{{ schema }}_meta
). dbt0.12
applies custom schema naming overrides to packages (dbt-labs/dbt-core#801), which causes this package to break.The primary issue I believe is the line below, which defines the schema name of audit log table, overriding any custom schema naming that the other models will now use:
https://github.com/fishtown-analytics/dbt-event-logging/blob/master/macros/audit.sql#L5
The text was updated successfully, but these errors were encountered: