Giter Site home page Giter Site logo

fivetran / dbt_hubspot_source Goto Github PK

View Code? Open in Web Editor NEW
28.0 40.0 32.0 3.57 MB

Data models for Hubspot built using dbt.

Home Page: https://fivetran.github.io/dbt_hubspot_source/

License: Apache License 2.0

Shell 100.00%
dbt dbt-packages fivetran hubspot

dbt_hubspot_source's Introduction

HubSpot Source dbt Package (Docs)

πŸ“£ What does this dbt package do?

  • Materializes HubSpot staging tables which leverage data in the format described by this ERD. These staging tables clean, test, and prepare your HubSpot data from Fivetran's connector for analysis by doing the following:
    • Name columns for consistency across all packages and for easier analysis
    • Adds freshness tests to source data
    • Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
  • Generates a comprehensive data dictionary of your HubSpot data through the dbt docs site.
  • These tables are designed to work simultaneously with our HubSpot transformation package.

🎯 How do I use the dbt package?

Step 1: Prerequisites

To use this dbt package, you must have the following:

  • At least one Fivetran HubSpot connector syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.

Databricks Dispatch Configuration

If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your dbt_project.yml. This is required in order for the package to accurately search for macros within the dbt-labs/spark_utils then the dbt-labs/dbt_utils packages respectively.

dispatch:
  - macro_namespace: dbt_utils
    search_order: ['spark_utils', 'dbt_utils']

Step 2: Install the package (skip if also using the hubspot transformation package)

Include the following hubspot_source package version in your packages.yml file.

TIP: Check dbt Hub for the latest installation instructions or read the dbt docs for more information on installing packages.

packages:
  - package: fivetran/hubspot_source
    version: [">=0.14.0", "<0.15.0"]

Step 3: Define database and schema variables

By default, this package runs using your destination and the hubspot schema. If this is not where your HubSpot data is (for example, if your HubSpot schema is named hubspot_fivetran), add the following configuration to your root dbt_project.yml file:

vars:
    hubspot_database: your_destination_name
    hubspot_schema: your_schema_name 

Step 4: Disable models for non-existent sources

When setting up your Hubspot connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Hubspot or have actively decided to not sync some tables. Therefore we have added enable/disable configs in the src.yml to allow you to disable certain sources not present. Downstream models are automatically disabled as well. In order to disable the relevant functionality in the package, you will need to add the relevant variables in your root dbt_project.yml. By default, all variables are assumed to be true (with exception of hubspot_service_enabled, hubspot_ticket_deal_enabled, hubspot_contact_merge_audit_enabled, and hubspot_merged_deal_enabled). You only need to add variables for the tables different from default:

# dbt_project.yml
vars:
  # Marketing

  hubspot_marketing_enabled: false                        # Disables all marketing models
  hubspot_contact_enabled: false                          # Disables the contact models
  hubspot_contact_list_enabled: false                     # Disables contact list models
  hubspot_contact_list_member_enabled: false              # Disables contact list member models
  hubspot_contact_property_enabled: false                 # Disables the contact property models
  hubspot_contact_property_history_enabled: false         # Disables the contact property history models
  hubspot_email_event_enabled: false                      # Disables all email_event models and functionality
  hubspot_email_event_bounce_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_deferred_enabled: false
  hubspot_email_event_delivered_enabled: false
  hubspot_email_event_dropped_enabled: false
  hubspot_email_event_forward_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_open_enabled: false
  hubspot_email_event_print_enabled: false
  hubspot_email_event_sent_enabled: false
  hubspot_email_event_spam_report_enabled: false
  hubspot_email_event_status_change_enabled: false
  
  hubspot_contact_merge_audit_enabled: true               # Enables the use of the CONTACT_MERGE_AUDIT table (deprecated by Hubspot v3 API) for removing merged contacts in the final models.
                                                          # If false, ~~~contacts will still be merged~~~, but using the CONTACT.property_hs_calculated_merged_vids field (introduced in v3 of the Hubspot CRM API)
                                                          # Default = false
  # Sales

  hubspot_sales_enabled: false                            # Disables all sales models
  hubspot_company_enabled: false
  hubspot_company_property_history_enabled: false         # Disable the company property history models
  hubspot_deal_enabled: false
  hubspot_merged_deal_enabled: true                       # Enables the merged_deal table, which will be used to filter out merged deals from the final deal models. False by default. Note that `hubspot_sales_enabled` and `hubspot_deal_enabled` must not be set to False.
  hubspot_deal_company_enabled: false
  hubspot_deal_contact_enabled: false
  hubspot_deal_property_history_enabled: false            # Disables the deal property history tables
  hubspot_engagement_enabled: false                       # Disables all engagement models and functionality
  hubspot_engagement_contact_enabled: false
  hubspot_engagement_company_enabled: false
  hubspot_engagement_deal_enabled: false
  hubspot_engagement_call_enabled: false
  hubspot_engagement_email_enabled: false
  hubspot_engagement_meeting_enabled: false
  hubspot_engagement_note_enabled: false
  hubspot_engagement_task_enabled: false
  hubspot_owner_enabled: false
  hubspot_property_enabled: false                         # Disables property and property_option tables

  # Service
  hubspot_service_enabled: true                           # Enables all service models
  hubspot_ticket_deal_enabled: true

Dbt-core Version Requirement for disabling freshness tests

If you are not using a source table that involves freshness tests, please be aware that the feature to disable freshness was only introduced in dbt-core 1.1.0. Therefore ensure the dbt version you're using is v1.1.0 or greater for this config to work.

(Optional) Step 5: Additional configurations

Adding passthrough columns

This package includes all source columns defined in the macros folder. Models by default only bring in a few fields for the company, contact, deal, and ticket tables. You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (alias) and casted (transform_sql) if desired, but not required. Datatype casting is configured via a sql snippet within the transform_sql key. You may add the desired sql while omitting the as field_name at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables within your root dbt_project.yml.

vars:
  hubspot__deal_pass_through_columns:
    - name:           "property_field_new_id"
      alias:          "new_name_for_this_field_id"
      transform_sql:  "cast(new_name_for_this_field as int64)"
    - name:           "this_other_field"
      transform_sql:  "cast(this_other_field as string)"
  hubspot__contact_pass_through_columns:
    - name:           "wow_i_can_add_all_my_custom_fields"
  hubspot__company_pass_through_columns:
    - name:           "this_is_radical"
      alias:          "radical_field"
      transform_sql:  "cast(radical_field as string)"
  hubspot__ticket_pass_through_columns:
    - name:           "property_mmm"
      alias:          "mmm"
    - name:           "property_hs_bop"
      alias:          "bop"

Alternatively, if you would like to simply pass through all columns in the above four tables, add the following configuration to your dbt_project.yml. Note that this will override any hubspot__[table_name]_pass_through_columns variables.

vars:
  hubspot__pass_through_all_columns: true # default is false

Adding property label

For property_hs_* columns, you can enable the corresponding, human-readable property_option.label to be included in the staging models.

Important!

  • You must have sources property and property_option enabled to enable labels. By default, these sources are enabled.
  • You CANNOT enable labels if using hubspot__pass_through_all_columns: true.`
  • We recommend being selective with the label columns you add. As you add more label columns, your run time will increase due to the underlying logic requirements.

To enable labels for a given property, set the property attribute add_property_label: true, using the below format.

vars:
  hubspot__ticket_pass_through_columns:
    - name: "property_hs_fieldname"
      alias: "fieldname"
      add_property_label: true

Alternatively, you can enable labels for all passthrough properties by using variable hubspot__enable_all_property_labels: true, formatted like the below example.

vars:
  hubspot__enable_all_property_labels: true # cannot use in conjunction with `hubspot__pass_through_all_columns: true`
  hubspot__ticket_pass_through_columns:
    - name: "property_hs_fieldname1"
    - name: "property_hs_fieldname2"

Including calculated fields

This package also provides the ability to pass calculated fields through to the company, contact, deal, and ticket staging models. If you would like to add a calculated field to any of the mentioned staging models, you may configure the respective hubspot__[table_name]_calculated_fields variables with the name of the field you would like to create, and the transform_sql which will be the actual calculation that will make up the calculated field.

vars:
  hubspot__deal_calculated_fields:
    - name:          "deal_calculated_field"
      transform_sql: "existing_field * other_field"
  hubspot__company_calculated_fields:
    - name:          "company_calculated_field"
      transform_sql: "concat(name_field, '_company_name')"
  hubspot__contact_calculated_fields:
    - name:          "contact_calculated_field"
      transform_sql: "contact_revenue - contact_expense"
  hubspot__ticket_calculated_fields:
    - name:          "ticket_calculated_field"
      transform_sql: "total_field / other_total_field"

Filter email events

When leveraging email events, HubSpot customers may take advantage of filtering out specified email events. These filtered email events are present within the stg_hubspot__email_events model and are identified by the is_filtered_event boolean field. By default, these events are included in the staging and downstream models generated from this package. However, if you wish to remove these filtered events you may do so by setting the hubspot_using_all_email_events variable to false. See below for exact configurations you may provide in your dbt_project.yml file:

vars:
  hubspot_using_all_email_events: false # True by default

Change the build schema

By default, this package builds the hubspot staging models within a schema titled (<target_schema> + _stg_hubspot) in your destination. If this is not where you would like your hubspot staging data to be written to, add the following configuration to your root dbt_project.yml file:

models:
    hubspot_source:
      +schema: my_new_schema_name # leave blank for just the target_schema

Change the source table references

If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:

IMPORTANT: See this project's dbt_project.yml variable declarations to see the expected names.

vars:
    hubspot_<default_source_table_name>_identifier: your_table_name 

(Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Coreβ„’

Fivetran offers the ability for you to orchestrate your dbt project through Fivetran Transformations for dbt Coreβ„’. Learn how to set up your project for orchestration through Fivetran in our Transformations for dbt Core setup guides.

πŸ” Does this package have dependencies?

This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the dbt hub site.

IMPORTANT: If you have any of these dependent packages in your own packages.yml file, we highly recommend that you remove them from your root packages.yml to avoid package version conflicts.

packages:
    - package: fivetran/fivetran_utils
      version: [">=0.4.0", "<0.5.0"]
    - package: dbt-labs/dbt_utils
      version: [">=1.0.0", "<2.0.0"]
    - package: dbt-labs/spark_utils
      version: [">=0.3.0", "<0.4.0"]

πŸ™Œ How is this package maintained and can I contribute?

Package Maintenance

The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend that you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.

Contributions

A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions!

We highly encourage and welcome contributions to this package. Check out this dbt Discourse article to learn how to contribute to a dbt package!

πŸͺ Are there any resources available?

  • If you have questions or want to reach out for help, please refer to the GitHub Issue section to find the right avenue of support for you.
  • If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our Feedback Form.
  • Have questions or want to be part of the community discourse? Create a post in the Fivetran community and our team along with the community can join in on the discussion!

dbt_hubspot_source's People

Contributors

abcurado avatar cmcau avatar dietofworms avatar dylanbaker avatar fivetran-catfritz avatar fivetran-chloe avatar fivetran-jamie avatar fivetran-joemarkiewicz avatar fivetran-reneeli avatar fivetran-seanodriscoll avatar fivetran-sheringuyen avatar greg-finley avatar jamesrayoub avatar jlmendgom5tran avatar jtcohen6 avatar kristin-bagnall avatar moreaupascal56 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbt_hubspot_source's Issues

[Bug] "this ERD" link not working

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

"this ERD" link not working on README. Should be https://fivetran.com/docs/applications/hubspot#schemainformation instead of https://fivetran.com/docs/applications/hubspot/#schemainformation

Relevant error log or model output

No response

Expected behavior

Goes to correct link

dbt Project configurations

n/a

Package versions

n/a

What database are you using dbt with?

other (mention it in "Additional Context")

dbt Version

n/a

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Extra comma causing compile issues in stg_hubspot__ticket

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Line 32 of stg_hubspot__ticket begins with a comma, however the remove_duplicate_and_prefix_from_columns macro also begins each line with a comma, resulting in a SQL compilation error. All other uses of this macro follow another pattern, though it should make for the same result. The other pattern does not include an additional comma between the fivetran_utils.fill_staging_columns and the remove_duplciate_and_prefix_from_columns macro calls.

Relevant error log or model output

00:26:45    Database Error in model stg_hubspot__ticket (models\stg_hubspot__ticket.sql)
  001003 (42000): SQL compilation error:
  syntax error line 169 at position 8 unexpected ','.
  compiled Code at target\run\hubspot_source\models\stg_hubspot__ticket.sql
00:26:45
00:26:45  Done. PASS=1 WARN=0 ERROR=1 SKIP=0 TOTAL=2


### Expected behavior

The models should be composed with valid SQL, passing through all columns from hubspot.

### dbt Project configurations

`hubspot__pass_through_all_columns: true`

### Package versions

0.14.0

### What database are you using dbt with?

snowflake

### dbt Version

Core 1.7.1
Snowflake 1.7.0

### Additional Context

_No response_

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

- [X] Yes.
- [ ] Yes, but I will need assistance and will schedule time during our [office hours](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) for guidance
- [ ] No.

FEATURE - Calculated Fields in Models

Are you a Fivetran customer?

Created by Joel Labes

Is your feature request related to a problem? Please describe.

No existing problem, the customer would like to include calculated fields in addition to the passthrough ability.

Describe the solution you'd like

Include a method for users to add calculated fields to the staging models which are calculated after the base fields and passthrough fields are added.

Describe alternatives you've considered

Adding calculated fields through the passthrough columns variable was attempted, but it is not the preferred solution. The better solution will be to add a new variable with this functionality.

Additional context

As this will most likely be a feature we could implement across packages then we will want to add this as a feature to fivetran_utils

Please indicate the level of urgency and business impact of this request

Normal

Are you interested in contributing to this package?

  • Yes, I can do this and open a PR for your review.
  • Possibly, but I'm not quite sure how to do this. I'd be happy to do a live coding session with someone to get this work implemented.
  • No, I'd prefer if someone else did this. I don't have the time and/or don't know how to incorporate the changes necessary.

This will be a Fivetran created feature.

[Bug] Use preserved word as alias in `stg_hubspot__contact`

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

In the stg_hubspot__contact there is the following macro, whose purpose is to rename the columns that have as prefix property and remove it. However, for the column property_delete the result of this transformation is delete. However, this world is preserved leading to unexpected behavior.
{{ fivetran_utils.remove_prefix_from_columns( columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_tmp')), prefix='property_', exclude=get_macro_columns(get_contact_columns())) }} {% endif %}

Relevant error log or model output

Database Error in model stg_hubspot__contact (models/stg_hubspot__contact.sql)
  001003 (42000): SQL compilation error:
  syntax error line 652 at position 27 unexpected 'DELETE'.
  compiled Code at target/run/hubspot_source/models/stg_hubspot__contact.sql

Expected behavior

The expected behavior is to give a different naming convention to this column. For example, is_contact_deleted

dbt Project configurations

dbt version: 1.7.4
adapter: snowflake 1.7.1

Package versions

Package version 0.14.0

What database are you using dbt with?

snowflake

dbt Version

dbt version: 1.7.4

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] stg_hubspot__contact: Duplication between PROPERTY_CREATEDATE and PROPERTY_CREATED_AT

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Hello,

I have an issue with a duplicate column, when running dbt run -s +stg_hubspot_contact I have the following error
Capture d’écran 2023-10-11 aΜ€ 10 47 18

I have hubspot__pass_through_all_columns: true

I had a closer look and it seems that the properties: PROPERTY_CREATEDATE and PROPERTY_CREATED_AT are named after prefix removal PROPERTY_CREATED_AT.

I think this is because in get_contact_columns() macro
the PROPERTY_CREATEDATE is mapped to created_at:
{"name": "property_createdate", "datatype": dbt.type_timestamp(), "alias": "created_at"},

The issue comes from the fact that the column PROPERTY_CREATED_AT is not excluded in the exclude parameter of stg_hubspot__contact which only returns these columns:

['_FIVETRAN_DELETED', '_FIVETRAN_SYNCED', 'ID', 'PROPERTY_HS_CALCULATED_MERGED_VIDS', 'PROPERTY_EMAIL', 'PROPERTY_COMPANY', 'PROPERTY_FIRSTNAME', 'PROPERTY_LASTNAME', 'PROPERTY_CREATEDATE', 'PROPERTY_JOBTITLE', 'PROPERTY_ANNUALREVENUE']

(so PROPERTY_CREATEDATE and not PROPERTY_CREATED_AT)

And then obviously PROPERTY_CREATED_AT is renamed as created_at and this is causing the issue.
Hope I was clear enough

Have a great day

Relevant error log or model output

see above

Expected behavior

Either exclude PROPERTY_CREATED_AT by default to avoid this issue or change PROPERTY_CREATEDATE mapping
I think the PROPERTY_ + aliases defined in get_contact_columns() macro
should be excluded as well.

dbt Project configurations

dbt hubspot source 0.12.0
dbt 1.4.4

Package versions

dbt hubspot source 0.12.0
dbt 1.4.4

What database are you using dbt with?

snowflake

dbt Version

dbt 1.4.4

Additional Context

maybe we will open a PR

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

Need a default to include all columns as passthrough (previous behavor)

Are you a Fivetran customer?
Mark Hansen
Consultant
Edcurs

Is your feature request related to a problem? Please describe.
I was using the feature that ALL columns got passed through and cleaned up ('property_' removed). Now, I have to create passthroughs for potentially hundreds of columns.

Describe the solution you'd like
Provide a variable setting that can bring back the old behavior and include All columns automatically as passthroughs. Something like passthrough_all_columns = true

Describe alternatives you've considered
Entering every single column as a name/alias pair in dbt_project.yml. Barf!

Additional context

Please indicate the level of urgency and business impact of this request
This upgrade broke our data warehouse and all dashboards. So, yes, it is urgent.

Are you interested in contributing to this package?

  • Yes, I can do this and open a PR for your review.
  • [ X] Possibly, but I'm not quite sure how to do this. I'd be happy to do a live coding session with someone to get this work implemented.
  • No, I'd prefer if someone else did this. I don't have the time and/or don't know how to incorporate the changes necessary.

[Feature] add conversion data to the hubspot__source table properties

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Hi there!

I find useful to have the Conversion Information of a contact in a the hubspot__contact table (from dbt_hubspot package), these are the informations mentioned here (section Conversion Information):

  • First conversion date
  • First conversion
  • etc

I did not find any of this data in the tables created by the hubspot transform package, so for now I'm using directly the table contact_form_submission imported by Fivetran. (with an aggregation data is good)

Maybe I did not search enough and this is already somewhere πŸ€”
Thx and Have a great day!

Describe alternatives you've considered

Continue using directly the table contact_form_submission

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

I just set up this dbt hubspot source package and it's really well explained, liked it ! :)

Add Service Hub models

Fivetran added the Service Hub tables to the connector last year and the following staging models should be created

  • ticket
  • ticket_company
  • ticket_contact
  • ticket_deal
  • ticket_engagement
  • ticket_property_history

[Bug] Aliasing column names in source macros instead of models

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

It looks like there are a couple of models in the dbt_hubspot_source package that currently performs aliasing in macros as opposed to directly in the staging model. Example. This issue is to migrate the aliasing into the model itself.

List of models:
-get_company_property_history_columns (will be fixed in as a result of another PR)
-get_contact_property_history_columns (will be fixed in as a result of another PR)
-get_deal_property_history_columns (will be fixed in as a result of another PR)
-get_email_event_dropped_columns
-get_email_event_sent_columns
-get_engagement_columns

Relevant error log or model output

No response

Expected behavior

N/A

dbt Project configurations

N/A

Package versions

package: fivetran/hubspot_source
version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

postgres, redshift, snowflake, bigquery

dbt Version

dbt 1.0.0

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Feature] Exclude foreign key references for deleted records

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Problem

Deleted records for deal, company, and ticket are excluded from their respective models, each with a final select of:

select *
from fields
where not coalesce(is_deleted, false)

However, ALL keys for these entities can appear in other models. The exclusion of deleted records isn't accounted for in other models, and can result in orphaned records.

For example, we had two companies merged into a single company, resulting in a deleted company record. Both companies shared the same deal_id. The deals_company table contains a record for each company, but only one company has a corresponding record in the hubspot_company table. This relationship resulted in a failing uniqueness test.


Solution

To maintain referential integrity, references to deleted entities should be removed from all models. ie, if a deleted company is excluded from the core company model, that deleted company_id should not appear in any other models.

This could be implemented via a macro that looks for foreign keys referencing any of the three models with deletes.

Some version of:

  • if source_columns in company_id
  • append "company id in (select company_id from stg_company) "

If this general approach makes sense, I can flesh out more specifics with the macro.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

original post in the #tools-fivetran channel in the dbt Slack

[Bug] Engagement Meeting Staging Model Has Wrong Variables

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Currently, the stg_hubspot__engagement_meeting has an incorrect variable within the enable config

{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}

Instead of the hubspot_engagement_email_enabled variable being included in the model, it should instead have hubspot_engagement_meeting_enabled.

This is because the hubspot_engagement_email_enabled variable should only apply to the email staging models. This model however should be configured to use the relevant variable that was created for the engagement meeting (hubspot_engagement_email_enabled).

Relevant error log or model output

See the error output in the additional details.

Expected behavior

The package uses the proper variables to disable this model.

dbt Project configurations

vars:
  hubspot_engagement_email_enabled: true
  hubspot_engagement_meeting_enabled: false

Package versions

packages:
  - package: fivetran/hubspot_source
    version: [">=0.6.0", "<0.7.0"]

What database are you using dbt with?

bigquery

dbt Version

dbt v1.2.0

Additional Context

image

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Feature] Optimize pass through all fields logic in staging models

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Currently we are performing a conditional check within the deal, contact, company, and ticket models when the hubspot__pass_through_all_columns variable is set to true. This conditional check is not the driest or most elegant code we could use in this situation. I would like to propose a feature for us to clean this logic up a bit more and make a provide a dryer and more elegant solution.

Describe alternatives you've considered

Using the current version. It should work, but it is not very dry.

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

This code was introduced within PR #

UNSUBSCRIBES does not exist

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I have 3 HubSpot accounts and using Fivetran to load the data into Snowflake (everything working fine) and then installed this package to transform the data so I can use it in Tableau.

Of the three accounts, two work the same (perfectly) but one has errors.

If I look at the created views there is a difference which probably means that the accounts are created/setup differently in HubSpot but I won't be able to change that I have to change dbt to cope.

Working view definition:
create or replace TRANSIENT TABLE DEV.CLOUD_DEV_SCHEMA_HUBSPOT_IST.HUBSPOT__EMAIL_SENDS ( EMAIL_SEND_ID VARCHAR(256), EVENT_ID VARCHAR(256), _FIVETRAN_SYNCED TIMESTAMP_TZ(9), BCC_EMAILS VARIANT, CC_EMAILS VARIANT, FROM_EMAIL VARCHAR(256), REPLY_TO_EMAIL VARIANT, EMAIL_SUBJECT VARCHAR(256), CREATED_TIMESTAMP TIMESTAMP_TZ(9), EMAIL_CAMPAIGN_ID NUMBER(38,0), RECIPIENT_EMAIL_ADDRESS VARCHAR(256), EMAIL_SEND_TIMESTAMP TIMESTAMP_TZ(9), CONTACT_ID NUMBER(38,0), BOUNCES NUMBER(18,0), CLICKS NUMBER(18,0), DEFERRALS NUMBER(18,0), DELIVERIES NUMBER(18,0), DROPS NUMBER(18,0), FORWARDS NUMBER(18,0), OPENS NUMBER(18,0), PRINTS NUMBER(18,0), SPAM_REPORTS NUMBER(18,0), WAS_BOUNCED BOOLEAN, WAS_CLICKED BOOLEAN, WAS_DEFERRED BOOLEAN, WAS_DELIVERED BOOLEAN, WAS_FORWARDED BOOLEAN, WAS_OPENED BOOLEAN, WAS_PRINTED BOOLEAN, WAS_SPAM_REPORTED BOOLEAN, UNSUBSCRIBES NUMBER(18,0), WAS_UNSUBCRIBED BOOLEAN );

NOT working view definition:

create or replace TRANSIENT TABLE DEV.DBT_CMCCLELLAN_HUBSPOT.HUBSPOT__EMAIL_SENDS ( EMAIL_SEND_ID VARCHAR(256), EVENT_ID VARCHAR(256), _FIVETRAN_SYNCED TIMESTAMP_TZ(9), BCC_EMAILS VARIANT, CC_EMAILS VARIANT, FROM_EMAIL VARCHAR(256), REPLY_TO_EMAIL VARIANT, EMAIL_SUBJECT VARCHAR(256), CREATED_TIMESTAMP TIMESTAMP_TZ(9), EMAIL_CAMPAIGN_ID NUMBER(38,0), RECIPIENT_EMAIL_ADDRESS VARCHAR(256), EMAIL_SEND_TIMESTAMP TIMESTAMP_TZ(9), CONTACT_ID NUMBER(38,0), BOUNCES NUMBER(18,0), CLICKS NUMBER(18,0), DEFERRALS NUMBER(18,0), DELIVERIES NUMBER(18,0), DROPS NUMBER(18,0), FORWARDS NUMBER(18,0), OPENS NUMBER(18,0), PRINTS NUMBER(18,0), SPAM_REPORTS NUMBER(18,0), WAS_BOUNCED BOOLEAN, WAS_CLICKED BOOLEAN, WAS_DEFERRED BOOLEAN, WAS_DELIVERED BOOLEAN, WAS_FORWARDED BOOLEAN, WAS_OPENED BOOLEAN, WAS_PRINTED BOOLEAN, WAS_SPAM_REPORTED BOOLEAN );

The working view has the last 2 columns (UNSUBSCBRIBES and WAS_UNSUBSCRIBED) and the NOT working one doesn't

Relevant error log or model output

Working view definition:

2022-04-17T02:08:50.684915Z: 02:08:50  Opening a new connection, currently in state closed
2022-04-17T02:08:52.129232Z: 02:08:52  Snowflake adapter: Snowflake query id: 01a3a860-3200-db59-0000-b28d0003a51a
2022-04-17T02:08:52.129359Z: 02:08:52  Snowflake adapter: Snowflake error: 000904 (42000): SQL compilation error: error line 56 at position 12
invalid identifier 'EMAIL_SENDS.UNSUBSCRIBES'
2022-04-17T02:08:52.129509Z: 02:08:52  finished collecting timing info
2022-04-17T02:08:52.129625Z: 02:08:52  On model.hubspot.hubspot__email_campaigns: Close
2022-04-17T02:08:52.596406Z: 02:08:52  Database Error in model hubspot__email_campaigns (models/marketing/hubspot__email_campaigns.sql)
  000904 (42000): SQL compilation error: error line 56 at position 12
  invalid identifier 'EMAIL_SENDS.UNSUBSCRIBES'
  compiled SQL at target/run/hubspot/models/marketing/hubspot__email_campaigns.sql
2022-04-17T02:08:52.596623Z: 02:08:52  Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9e6c0a19-5e4a-42b0-a4ed-ace800c91180', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7f5858410550>]}
2022-04-17T02:08:52.596923Z: 02:08:52  77 of 78 ERROR creating table model dbt_cmcclellan_hubspot.hubspot__email_campaigns [ERRORοΏ½ in 1.97s]
2022-04-17T02:08:52.597039Z: 02:08:52  Finished running node model.hubspot.hubspot__email_campaigns
Database Error in model hubspot__email_campaigns (models/marketing/hubspot__email_campaigns.sql)
  000904 (42000): SQL compilation error: error line 56 at position 12
  invalid identifier 'EMAIL_SENDS.UNSUBSCRIBES'
  compiled SQL at target/run/hubspot/models/marketing/hubspot__email_campaigns.sql

Expected behavior

I expect this package to handle the data when the unsubscribe columns are missing

dbt Project configurations

I'm using dbt Cloud, my dbt_project_yml in the root folder is :

`

Name your project! Project names should contain only lowercase characters

and underscores. A good package name should reflect your organization's

name or the intended use of these models

name: 'hubspot_CHANGETHIS'
version: '1.0.0'
config-version: 2

This setting configures which "profile" dbt uses for this project.

profile: 'default'

These configurations specify where dbt should look for different types of files.

The source-paths config, for example, states that models in this project can be

found in the "models/" directory. You probably won't need to change these!

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

target-path: "target" # directory which will store compiled SQL files
clean-targets: # directories to be removed by dbt clean

  • "target"
  • "dbt_packages"

Configuring models

Full documentation: https://docs.getdbt.com/docs/configuring-models

In this example config, we tell dbt to build all models in the example/ directory

as tables. These settings can be overridden in the individual model files

using the {{ config(...) }} macro.

models:
hubspot_CHANGETHIS:
# Applies to all files under models/example/
example:
materialized: view

vars:
hubspot_source:
hubspot_database: CHANGETHIS
hubspot_schema: hubspot_CHANGETHIS

Marketing

hubspot_contact_list_enabled: false # Disables contact list models
hubspot_contact_list_member_enabled: false # Disables contact list member models
hubspot_email_event_forward_enabled: false
hubspot_email_event_print_enabled: false
hubspot_email_event_spam_report_enabled: false
hubspot_email_event_status_change_enabled: false
hubspot_engagement_deal_enabled: false`

Package versions

`packages:

  • package: fivetran/hubspot
    version: [">=0.5.0", "<0.6.0"]`

What database are you using dbt with?

snowflake

dbt Version

dbt Cloud dbt --version doesn't work but I can see on the menu it's 1.1.45.258

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] missing source column causing model error

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

We're running into an error running stg_hubspot__deal. The property_closedate column is the issue because it is not included in our instance of the deal source table. We have hubspot__deal_pass_through_columns enabled, which bypasses the macro CTE where those columns are staged.

Relevant error log or model output

No response

Expected behavior

The staged columns created in the macro CTE would be used irrespective of the use of the hubspot__deal_pass_through_columns.

dbt Project configurations

hubspot__pass_through_all_columns: true

Package versions

package: fivetran/hubspot
version: [">=0.8.0", "<0.9.0"]

What database are you using dbt with?

redshift

dbt Version

1.3

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Staging .yml docs missing column descriptions

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

In doing a spot check of the docs, some model column descriptions are missing or appear not to match the data type. See stg_hubspot__company or stg_hubspot__contact_list as examples.

Suggest to audit and update table descriptions.

Relevant error log or model output

No response

Expected behavior

All columns should have a correct description.

dbt Project configurations

n/a

Package versions

0.6.3

What database are you using dbt with?

bigquery

dbt Version

n/a

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Staging models with where clause before fill_staging_columns macro

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

There are a few staging models where there is a where clause within the first CTE before the fill_staging_columns macro is created.

This can cause errors if the field in the where clause is not in the source table. See here for an example of this error.

Relevant error log or model output

15:24:45  Database Error in model stg_hubspot__contact_list_member (models/stg_hubspot__contact_list_member.sql)
15:24:45    column "_fivetran_deleted" does not exist
15:24:45    LINE 12:     where not coalesce(_fivetran_deleted, false)

Expected behavior

The staging model leverages the fill_staging_columns macro to pass a null record in when the field does not exist in the source table.

dbt Project configurations

N/A

Package versions

packages:

  • package: fivetran/hubspot_source
    version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

postgres, redshift, snowflake, bigquery, databricks

dbt Version

installed version: 1.0.4
   latest version: 1.1.0

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

No row returned by stg_hubspot__deal_pipeline_stage

I'm using the package and I have an issue with stg_hubspot__deal_pipeline_stage.sql.

The code says:
where _fivetran_deleted is null

In my case, I have no row with null values. Only true/false. Therefore no row is returned. So you should check for false values as well.

deal_adapter and contact_adapter are not created

Hi there folks,

My hubspot schema is not hubspot, but I've changed it on dbt_project.yml. But some models like:

  • stg_hubspot__deal_adapter
  • stg_hubspot__contact_adapter

Are still using hubspot as schema. Other models are just fine (but those are the base for plenty of other models).

Examples of compiled SQL

contact_adapter
image
deal_pipeline
image

Extra info

dbt on 0.18.0 and Redshift as my warehouse.

[Feature] Provide Support for HubSpot API v3 Updates

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

In May 2023 there were changes to the HubSpot connector that resulted in a myriad of changes to tables in order to support the HubSpot API v3. See the full list of changes to the connector here.

This feature will be to offer support for this new version of the connector. However, we will also likely want to ensure the older versions of the package works with previous connector build. Will consult with internal teams on best approach going forward.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Bug] custom fields unexpectedly change datatype

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

We're ingesting custom Hubspot fields via hubspot__deal_pass_through_columns argument.

When these are timestamps, some appear to be created in Hubspot's database as a NUMBER(38) while others are TIMESTAMP_TZ.

We're converting the NUMBER ones into timestamps in downstream dbt models.

HOWEVER, one of these fields has changed from a NUMBER to a TIMESTAMP_TZ unexpectedly. This broke our dbt snapshots on this data.

The Hubspot users have ensured me they did nothing to that field. Perhaps Hubspot internally changed something in their database, or perhaps the end users did alter something without realizing.

Either way, this field was being built as a NUMBER for months, and then randomly switched to a TIMESTAMP_TZ. I was able to find the query in the Snowflake history, in which Fivetran issued a simple alter statement to this table and started upserting with the new time after that. I'm not able to pin down an event that would've caused this change.

Relevant error log or model output

:25:07  Completed with 1 error and 0 warnings:
19:25:07  
19:25:07  Database Error in snapshot hubspot__deal__snapshot (snapshots/hubspot_source/hubspot__deal__snapshot.sql)
19:25:07    002023 (22000): SQL compilation error:
19:25:07    Expression type does not match column data type, expecting NUMBER(38,0) but got TIMESTAMP_TZ(9) for column PROPERTY_CHANNEL_INFLUENCED_DATE
19:25:07    compiled Code at xxx.sql

Expected behavior

I expect these source tables with custom fields to never change underlying datatype unless something actively seeks to do so.

dbt Project configurations

hubspot__deal_pass_through_columns:

Package versions

packages:
  - package: elementary-data/elementary
    version: [">=0.7.0", "<0.8.0"]
  - package: get-select/dbt_snowflake_monitoring
    version: 2.0.2
  - package: fivetran/google_ads
    version: [">=0.9.0", "<0.10.0"]
  - package: fivetran/hubspot
    version: [">=0.8.0", "<0.9.0"]
  - package: fivetran/facebook_ads
    version: [">=0.6.0", "<0.7.0"]
  - package: fivetran/linkedin
    version: [">=0.6.0", "<0.7.0"]
  - package: fivetran/ad_reporting
    version: [">=1.2.0", "<1.3.0"]
  - package: dbt-labs/codegen
    version: [">=0.9.0", "<0.10.0"]
  - package: dbt-labs/dbt_external_tables
    version: 0.8.2
  - package: Snowflake-Labs/dbt_constraints
    version: [">=0.6.0", "<0.7.0"]

What database are you using dbt with?

snowflake

dbt Version

  - installed: 1.3.1
  - latest:    1.4.4 - Update available!

Plugins:
  - snowflake: 1.3.0 - Update available!

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Feature] Add `type_id` to `DEAL_COMPANY` and `DEAL_CONTACT`

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

In the May 2023 connector update type_id was added to DEAL_COMPANY and DEAL_CONTACT as a part of the composite primary key for these tables. This column needs to be added to the corresponding models.

Also from the update, columns updated_at and created_at were added to several tables. Those should incorporated as well.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Bug] Freshness test in `email_event` source table

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The src_hubspot.yml for this package contains a freshness test to one table only email_event. Even if I disable the table in dbt_project.yml the freshness check will be in place when running dbt source freshness. Is this the expected behavior?

Relevant error log or model output

Output


12:30:37  Database Error in source email_event (models/src_hubspot.yml)
12:30:37    002003 (42S02): SQL compilation error:
12:30:37    Object 'RAW.HUBSPOT.EMAIL_EVENT' does not exist or not authorized.

dbt_project.yml variables:

  hubspot_database: raw
  hubspot_schema: hubspot
  hubspot_contact_list_enabled: false
  hubspot_contact_list_member_enabled: false
  hubspot_email_event_enabled: false
  hubspot_email_event_bounce_enabled: false
  hubspot_email_event_deferred_enabled: false
  hubspot_email_event_delivered_enabled: false
  hubspot_email_event_dropped_enabled: false
  hubspot_email_event_forward_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_opens_enabled: false
  hubspot_email_event_print_enabled: false
  hubspot_email_event_sent_enabled: false
  hubspot_email_event_spam_report_enabled: false
  hubspot_email_event_status_change_enabled: false
  hubspot_engagement_email_enabled: false
  hubspot_engagement_note_enabled: false
  hubspot_engagement_meeting_enabled: false
  hubspot_engagement_task_enabled: false

Expected behavior

No freshness check in a disabled table.

dbt Project configurations

 hubspot_database: raw
  hubspot_schema: hubspot
  hubspot_contact_list_enabled: false
  hubspot_contact_list_member_enabled: false
  hubspot_email_event_enabled: false
  hubspot_email_event_bounce_enabled: false
  hubspot_email_event_deferred_enabled: false
  hubspot_email_event_delivered_enabled: false
  hubspot_email_event_dropped_enabled: false
  hubspot_email_event_forward_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_opens_enabled: false
  hubspot_email_event_print_enabled: false
  hubspot_email_event_sent_enabled: false
  hubspot_email_event_spam_report_enabled: false
  hubspot_email_event_status_change_enabled: false
  hubspot_engagement_email_enabled: false
  hubspot_engagement_note_enabled: false
  hubspot_engagement_meeting_enabled: false
  hubspot_engagement_task_enabled: false

Package versions

packages:
  - package: dbt-labs/dbt_utils
    version: 0.8.5
  - package: tnightengale/dbt_meta_testing
    version: 0.3.5
  - package: calogica/dbt_expectations
    version: 0.5.6
  - package: fivetran/facebook_ads
    version: [">=0.4.0", "<0.5.0"]
  - package: fivetran/hubspot
    version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

snowflake

dbt Version

Core:
  - installed: 1.1.1
  - latest:    1.1.1 - Up to date!

Plugins:
  - snowflake: 1.1.0 - Up to date!
  

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Feature] Update for compiling

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

When starting on a brand-new schema, dbt compile fails, most likely due to this line. Possible solution is changing the relation on that line from a ref to a source.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Bug] stg_hubspot__deal_contact is nowhere to be found

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

In the ERD provided by Fivetran [1] there is a model for deal_contact but we can't see this anywhere in the package or this repo.

[1] https://docs.google.com/presentation/d/1KABQnt8WmtZe7u5l7WFUoPIsWzv63P9gsWF79XGLoZE/edit#slide=id.gd207c04e3c_4_5

Relevant error log or model output

No response

Expected behavior

The model file exists in the package

dbt Project configurations

models:
  hubspot_source:
    +schema: staging

...
vars:
  # Hubspot source package config
  hubspot_database: raw
  hubspot_schema: hubspot_fivetran
...

Package versions

  - package: fivetran/hubspot_source
    version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

snowflake

dbt Version

snowflake: 1.0.1

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Bug] Hubspot Deal Transformation Data Type Error

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The transformation logic for hubspot__deals expects deal_pipeline_id and deal_pipeline_stage_id to be strings, but sometimes the source has them as integers. This causes these joins in the transformation:

left join pipelines 
    on deals.deal_pipeline_id = pipelines.deal_pipeline_id
left join pipeline_stages 
    on deals.deal_pipeline_stage_id = pipeline_stages.deal_pipeline_stage_id

to fail with the error:

No matching signature for operator = for argument types: INT64, STRING. Supported signature: ANY = ANY

It's not clear to be what caused these columns to be created as integers in our BigQuery instance, but that is the case for us.

Relevant error log or model output

`No matching signature for operator = for argument types: INT64, STRING. Supported signature: ANY = ANY`

Expected behavior

Successful joins between deal IDs of the same data type.

dbt Project configurations

vars:
hubspot__pass_through_all_columns: true

Package versions

packages:

  • package: fivetran/hubspot
    version: [">=0.9.0", "<0.10.0"]

What database are you using dbt with?

bigquery

dbt Version

1.4.6

Additional Context

Case #142434

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

[Feature] Include Deleted Deal Pipelines & Deal Pipeline Stages

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

HubSpot hard-deletes deal pipelines and deal pipeline stages from the workspace but Fivetran does capture using _fivetran_deleted. For historical deal stage activity, in instances where the deal stage may have been deleted, it would be helpful to have the added context as to what that previous stage was rather than simply returning a null value.

A simple fix would be to remove where not coalesce(_fivetran_deleted, false) from both stg_hubspot__deal_pipeline and stg_hubspot__deal_pipeline_stage. Given _fivetran_deleted is provided in the resulting view for each, the end user can filter out deleted deal stages when applicable

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

[Feature] Understanding Snowflake and tmp view models

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Continuing discussions from this slack thread and this one, this issue is for a deeper investigation into this.

The problem arises in Snowflake when a source's dimensions changes, but the dbt model has been run again.

The proposed solution is to update our tmp view models is to use dbt_utils.star at least for Snowflake targets.

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

Managing source freshness snapshots

We've turned off one of the tables in the fivetran connector (contact_property_history) because the MAR is quite high.
This causes the freshness snapshots to fail in dbt cloud.
dbt doesn't currently(17.1) let you provide arguments to exclude from freshness snapshots you either have to be explicit in the command or use default(all sources)

We don't want to disable the downstream models from this table, we're just happy to have some fields out of date.
Unfortunately the only parameter we can set to avoid this also disables the engagements models.

It might be useful to have a way to turn off sources in dbt_project.yml similar to how other variables work in the package.

Current

      - name: contact_property_history
        freshness:
          warn_after: {count: 84, period: hour}
          error_after: {count: 168, period: hour}

Preferred outcome

      - name: contact_property_history
        freshness: null

[Feature] Add databricks compatibility

Is there an existing feature request for this?

  • I have searched the existing issues

Describe the Feature

Internally created - Add databricks compatibility

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

  • Yes.
  • Yes, but I will need assistance and will schedule time during your office hours for guidance.
  • No.

Anything else?

No response

Ticket models are not created

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Company, Deal, Email, Engagement, and Owner staging tables are created fine but the Ticket tables are missing. Do they have to be enabled specifically?

Relevant error log or model output

No response

Expected behavior

Stg views defined in dbt_project.yml are available:

    ticket_company: "{{ source('hubspot','ticket_company') }}"
    ticket_contact: "{{ source('hubspot','ticket_contact') }}"
    ticket_deal: "{{ source('hubspot','ticket_deal') }}"
    ticket_engagement: "{{ source('hubspot','ticket_engagement') }}"
    ticket_pipeline: "{{ source('hubspot','ticket_pipeline') }}"
    ticket_pipeline_stage: "{{ source('hubspot','ticket_pipeline_stage') }}"
    ticket_property_history: "{{ source('hubspot','ticket_property_history') }}"
    ticket: "{{ source('hubspot','ticket') }}"

dbt Project configurations

vars:
hubspot_source:
hubspot_database: FIVETRAN
hubspot_schema: hubspot
hubspot_email_event_print_enabled: false
hubspot_email_event_forward_enabled: false
hubspot_contact_merge_audit_enabled: true
hubspot__pass_through_all_columns: true

Package versions

packages:

  • package: dbt-labs/audit_helper
    version: 0.5.0
  • package: fivetran/hubspot
    version: [">=0.5.0", "<0.6.0"]

What database are you using dbt with?

snowflake

dbt Version

1.2

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

Git merge artifacts in package docs

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Hi - on https://hub.getdbt.com/fivetran/hubspot/latest/ there are git merge artifacts

image

image

Relevant error log or model output

No response

Expected behavior

no artifacts

dbt Project configurations

n/a

Package versions

n/a

What database are you using dbt with?

snowflake

dbt Version


Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

Need variables to suppress list models

It would be great if you had variables to turn off the models for contact_list and contact_list_member, like this:

    hubspot_contact_list_enabled: false
    hubspot_contact_list_member_enabled: false

Right now, we can only turn on/off the email models at a granular level. We should be able to turn on/off contact lists as well, because Fivetran actually recommends against using the contact_list_member table (Non-incremental and slow).

Not able to retrieve the company id associated to a deal

Currently, the deal model doesn't contain the company id to which the deal is associated. This is probably because the assocaited company id is stored in another table (DEAL_COMPANY with a 1..n relation with DEAL and COMPANY). This other table supposes that a deal could be associated to multiple companies but actually, Hubspot doesn't allow that. So it would be very useful to have the company_id in the deal model.

Otherwise, at least having the deal_company model would be great. Currently, with the package, there is no way to retrieve the company id and I have to make my own staging model querying the source data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.