-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-1920] [Bug] Running dbt with state comparison fails if an exposure is disabled #6752
Comments
Hey @rileyschack thanks for "exposing" this situation! Based on the error message you got using We just released dbt 1.4 two days ago, and I'm guessing you would still see a similar error since So this looks like a bug that we'll need to fix, and #6753 will help proactively test for this type of situation in the future. In the meantime, do you have a workaround that you are using? |
@dbeatty10 Thanks for looking into this. My team doesn't have a workaround for this--we were waiting for v1.3 to implement exposures because we needed the Do we have an ETA for the fix? Would it make it into the v1.4.2 release? |
Sure thing @rileyschack ! We don't currently have an ETA on this fix. Oftentimes, our bugfixes will only be applied to the next minor version of dbt-core (which is 1.5.0). There are specific scenarios where we will backport a bug fix in a version like
The reason that Scenario 3 is scoped so tightly is so that we can avoid having a new bugfix accidentally create a new bug and affect folks that were previously fine. This bug has been pre-existing for multiple versions, so we'd be looking at either Scenario 3 or our next minor version after a fix is merged. I ran this by PM @jtcohen6 and he said it does feel like something that we could include in a v1.4.x patch release 🎉 So we can learn more about how this config is planned to be used, what's effect(s) would you have by not being able to disable exposures? Here's a super hacky workaround which may (or may not!) work for you in the meantime:
|
@dbeatty10 Thanks for the response--super helpful. I'll keep my fingers crossed for a v1.4.x release since v1.5 is still a few months away 😅 My team has to manage a multi-region dbt project (i.e. each region has a dev/prod target), and we aren't always able to materialize every model in each region (mostly because we don't want to litter each project with null tables). This also means that we have multiple instances of our BI tools (e.g. US, UK, Global) that connect to the different regional BQ projects. What happens some of the time is that we have a dashboard in 1 region that refs a model that is only enabled in that specific region. This is a key reason we were waiting for the v1.3 release of dbt to start using exposures. A more representative setup would be like this: version: 2
exposures:
- name: my_first_exposure
type: dashboard
depends_on:
# this model is only available in prod-uk and dev-uk
- ref("my_second_dbt_model")
owner:
email: [email protected]
url: my_url
config:
enabled: "{{ target.name == 'prod-uk' }}" |
Ah, I see what you are hoping to do with conditionally setting |
Relates to #6753 |
Will need to think about if we want to backport this with the test from #6753 or not. But that ticket should be done with this. |
Is this a new bug in dbt-core?
Current Behavior
State comparison fails (i.e.
dbt run -s state:modified -t dev --state prod-target
) if an exposure is disabled.Expected Behavior
State comparison runs should work regardless if an exposure is disabled.
Steps To Reproduce
dbt init
with several modifications:profiles.yml
models/example/my_exposures.yml
models/example/my_first_dbt_model.sql
to trigger a state change, then ran:Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
Enabled nodes in
dev
:As soon as I change
my_first_exposure
toenabled: true
, then state comparison works again.The text was updated successfully, but these errors were encountered: