Open jtcohen6 opened 1 year ago
Does any_field_i_want
imply breaking out of the meta
sandbox, or do you just mean any_already_defined_field_i_want
?
Does
any_field_i_want
imply breaking out of themeta
sandbox, or do you just meanany_already_defined_field_i_want
?
Fair point! Users (and adapter maintainers) can already define whatever custom configs they want, and access them via {{ config.get() }}
.
If this is the route we go down, there will be very little functional difference between sticking a totally custom field in the "extra" dict (implicitly), versus putting it in the meta
dict (explicitly). We'd either want to:
meta
allows you to decorate it with some extra fields that appear in more-predictable ways in downstream metadata (artifacts & logs)."meta
... knowing that we'd need to keep around this back-compat for a long long time, and we'd also need to get "adapter-specific" configs actually working again, lest we be recommending that adapter maintainers continue relying on an officially deprecated pattern.Huh! TIL.
I would lean towards the first option - keep them both but explain what context is appropriate for each.
If we totally removed the config
dict, and allowed users to specify whatever (valid) keys they wanted as top-level properties, it would make it more difficult for us to catch typos & provide a helpful warning: https://github.com/dbt-labs/dbt-core/issues/5605#issuecomment-1209317030 / https://github.com/dbt-labs/dbt-core/issues/6008
But it's already the case that we don't / can't catch a typo for a config
entry, e.g.:
config:
matrialized: table
@gshank and I discussed potentially pulling this as follow-on work, as part of stabilizing artifact (manifest) interfaces. It's still not top priority must-have, but it would be thematic with that effort.
copying from internal Slack
At first blush, these feel like desirable UX outcomes for our artifacts / metadata interface:
dbt-core
, can be any data type) into an extra dictionary. That would still be our "anything goes" grab bag.And for the developer UX:
Internal Notion with more background & context: https://www.notion.so/dbtlabs/Why-Configs-0ab08bbf3bb34c84bc70c3e57b4f575e?pvs=4
Example
With the addition of frontmatter (#7100):