Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dbt): read dbt +meta from +config when present #20296

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

rexledesma
Copy link
Member

Summary & Motivation

From https://docs.getdbt.com/reference/resource-configs/meta:

Depending on the resource you're configuring, meta may be available within the config property, and/or as a top-level key. (For backwards compatibility, meta is often (but not always) supported as a top-level key, though without the capabilities of config inheritance.)

This affects sources, as +meta config inheritance is applied in the top level +config field, rather than in the top level +meta field.

This change reads from +config when present to read +meta. Otherwise, we fall back to reading from the top level +meta field.

How I Tested These Changes

pytest

Copy link
Member Author

rexledesma commented Mar 6, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rexledesma and the rest of your teammates on Graphite Graphite

@rexledesma rexledesma force-pushed the rl/read-dbt-config-inheritance-sources branch 2 times, most recently from 89b8db1 to 8d141c1 Compare March 6, 2024 16:16
@rexledesma rexledesma force-pushed the rl/read-dbt-config-inheritance-sources branch from 8d141c1 to ff00b7c Compare March 6, 2024 17:02
@rexledesma rexledesma changed the base branch from flexible_upstream_asset_association to master March 6, 2024 17:02
Copy link

github-actions bot commented Mar 6, 2024

Deploy preview for dagster-university ready!

✅ Preview
https://dagster-university-pw1xf89s1-elementl.vercel.app
https://rl-read-dbt-config-inheritance-sources.dagster-university.dagster-docs.io

Built with commit ff00b7c.
This pull request is being automatically deployed with vercel-action

Copy link

github-actions bot commented Mar 6, 2024

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-n85d6yqmm-elementl.vercel.app
https://rl-read-dbt-config-inheritance-sources.core-storybook.dagster-docs.io

Built with commit ff00b7c.
This pull request is being automatically deployed with vercel-action

Copy link
Contributor

@OwenKephart OwenKephart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would ditch the type annotation but otherwise looks good

@rexledesma rexledesma force-pushed the rl/read-dbt-config-inheritance-sources branch from ff00b7c to 1d756c0 Compare March 6, 2024 17:08
@rexledesma rexledesma merged commit 90ad91f into master Mar 6, 2024
1 check passed
@rexledesma rexledesma deleted the rl/read-dbt-config-inheritance-sources branch March 6, 2024 17:32
PedramNavid pushed a commit that referenced this pull request Mar 28, 2024
## Summary & Motivation
From https://docs.getdbt.com/reference/resource-configs/meta:

> Depending on the resource you're configuring, meta may be available
within the config property, and/or as a top-level key. (For backwards
compatibility, meta is often (but not always) supported as a top-level
key, though without the capabilities of config inheritance.)

This affects sources, as `+meta` config inheritance is applied in the
top level `+config` field, rather than in the top level `+meta` field.

This change reads from `+config` when present to read `+meta`.
Otherwise, we fall back to reading from the top level `+meta` field.

## How I Tested These Changes
pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants