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] hubspot_engagement_contact_enabled needs to be taken into consideration within hubspot__contacts model #125

Closed fivetran-joemarkiewicz closed 9 months ago

fivetran-joemarkiewicz commented 10 months ago

Is there an existing issue for this?

Describe the issue

Currently if you are using the hubspot__contacts end model, it offers the ability to turn on/off the engagements portions using this config.

When inspecting the code block that leverages this config you can see it is pulling from the int_hubspot__engagement_metrics__by_contact model. However, upon inspecting that intermediate model you can see the model is dependent on the following variables.

https://github.com/fivetran/dbt_hubspot/blob/6b1900d539e71b531e65b1ae889e6b2758c29e0f/models/marketing/intermediate/int_hubspot__engagement_metrics__by_contact.sql#L1

As you can see there is an inconsistency where the intermediate model is able to be disabled by the hubspot_engagement_contact_enabled variable. Whereas the end model does not take this additional variable into consideration.

We will need to update the hubspot__contacts end model to take the hubspot_engagement_contact_enabled variable into consideration. If we do not, a customer may have the intermediate model disabled, but not the end model. Which will cause a runtime failure.

Relevant error log or model output

13:52:29  Running with dbt=1.5.1
13:52:29  Unable to do partial parsing because saved manifest not found. Starting full parse.
13:52:34  Encountered an error:
Compilation Error
  Model 'model.hubspot.hubspot__contacts' (models/marketing/hubspot__contacts.sql) depends on a node named 'int_hubspot__engagement_metrics__by_contact' which is disabled

Expected behavior

The package is able to run without any errors regardless of the variable configurations.

dbt Project configurations

dbt=1.5.1

Package versions

v0.14.0

What database are you using dbt with?

snowflake

dbt Version

1.5.1

Additional Context

No response

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

fivetran-catfritz commented 9 months ago

This update has been released in the latest version, so closing this issue out!