fivetran / dbt_hubspot

Data models for Hubspot built using dbt.
https://fivetran.github.io/dbt_hubspot/
Apache License 2.0
33 stars 38 forks source link

[Bug] dbt Cloud PR builds fail when hubspot models are disabled and I run `dbt build --select state:modified+` #95

Closed cjcdoomed closed 1 year ago

cjcdoomed commented 1 year ago

Is there an existing issue for this?

Describe the issue

I'd like to temporarily disable model creation for the hubspot package, or disable it in pre-production environments. In my dbt_project.yml

' models: hubspot: +enabled: false hubspot_source: +enabled: false `

Relevant error log or model output

------------------------------------------------------------
  Invoke dbt Command
------------------------------------------------------------
dbt build --select state:modified+

19:39:48  Running with dbt=1.3.2
19:39:48  Partial parse save file not found. Starting full parse.
Compilation Error in model stg_hubspot__company_tmp (models/tmp/stg_hubspot__company_tmp.sql)
  Model 'model.hubspot_source.stg_hubspot__company_tmp' (models/tmp/stg_hubspot__company_tmp.sql) depends on a source named 'hubspot.company' which is disabled

Expected behavior

Expected no errors and no hubspot models created.

dbt Project configurations

hubspot_email_event_forward_enabled: false hubspot_email_event_print_enabled: false hubspot_sales_enabled: false hubspot_service_enabled: false

Package versions

packages:

What database are you using dbt with?

snowflake

dbt Version

1.3

Additional Context

No response

Are you willing to open a PR to help address this issue?

fivetran-joemarkiewicz commented 1 year ago

Hi @cjcdoomed thanks for opening this issue.

What you are looking to do should be a native functionality of dbt. I don't foresee this being something that would need to be edited within the package to effectively disable the models if you don't want to run them. Would you be able to share the full indentation config of your models section?

I was able to run the following and see that the hubspot and hubspot_source models were not run:

models:
  hubspot:
    +enabled: false
  hubspot_source:
    +enabled: false

image

I wonder if there may some hierarchy or indentation mixup in your dbt_project.yml configuration that is not properly disabling the package models.

fivetran-joemarkiewicz commented 1 year ago

Hi @cjcdoomed I believe the above should account for the issue at hand. If you do still encounter an error then I feel this should be an issue opened within dbt core as it seems to be a nuance with the build command and how it interacts with package models.

As such, I will close this issue. Please feel free to reopen if you would like to discuss this further.