Skip to content

Commit

Permalink
Merge pull request #57 from fivetran/bugfix/casting-pipeline-int
Browse files Browse the repository at this point in the history
Applied casting to staging models
  • Loading branch information
fivetran-joemarkiewicz authored Feb 1, 2022
2 parents 76a9360 + c05db8c commit 7be0e29
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# dbt_hubspot_source v0.5.3

## Under the Hood
- Cast the `deal_pipeline_stage_id` and `deal_pipeline_id` fields within the stg_hubspot__deal_pipeline, stg_hubspot__deal_pipeline_stage, stg_hubspot__deal using the `dbt_utils.type_string()` macro. This ensures joins in downstream models are accurate across warehouses. ([#57](https://github.com/fivetran/dbt_hubspot_source/pull/57))

# dbt_hubspot_source v0.5.2

### Updates
## Updates
- Removing unused models `stg_hubspot__engagement_email_cc` and `stg_hubspot__engagement_email_to` from `stg_hubspot__engagement.yml` ([#56](https://github.com/fivetran/dbt_hubspot_source/pull/56))

## Contributors
- @ericalouie ([#60](https://github.com/fivetran/dbt_hubspot/issues/60)).

# dbt_hubspot_source v0.5.1

### Updates
## Updates
- Updating `README.md` to reflect global variable references in `dbt_project.yml` to be consistent with `dbt_hubspot` package.
# dbt_hubspot_source v0.5.0
🎉 dbt v1.0.0 Compatibility 🎉
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot_source'
version: '0.5.2'
version: '0.5.3'
config-version: 2
require-dbt-version: [">=1.0.0", "<2.0.0"]

Expand Down
8 changes: 7 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

name: 'hubspot_source_integration_tests'
version: '0.5.2'
version: '0.5.3'
profile: 'integration_tests'
config-version: 2

Expand Down Expand Up @@ -113,6 +113,12 @@ seeds:
engagement_note_data:
+column_types:
engagement_id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
deal_pipeline_data:
+column_types:
pipeline_id: "{{ 'varchar(100)' if target.type in ('redshift','postgres') else 'string'}}"
deal_pipeline_stage_data:
+column_types:
stage_id: "{{ 'varchar(100)' if target.type in ('redshift','postgres') else 'string'}}"
email_event_sent_data_snowflake:
+enabled: "{{ true if target.type == 'snowflake' else false }}"
email_event_sent_data_postgres:
Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__deal.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ with base as (
-- just default columns + explicitly configured passthrough columns
_fivetran_synced,
deal_id,
deal_pipeline_id,
deal_pipeline_stage_id,
cast(deal_pipeline_id as {{ dbt_utils.type_string() }}) as deal_pipeline_id,
cast(deal_pipeline_stage_id as {{ dbt_utils.type_string() }}) as deal_pipeline_stage_id,
owner_id,
portal_id,
property_dealname as deal_name,
Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__deal_pipeline.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ with base as (
active as is_active,
display_order,
label as pipeline_label,
pipeline_id as deal_pipeline_id
cast(pipeline_id as {{ dbt_utils.type_string() }}) as deal_pipeline_id
from macro

)
Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__deal_pipeline_stage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ with base as (
label as pipeline_stage_label,
pipeline_id as deal_pipeline_id,
probability,
stage_id as deal_pipeline_stage_id
cast(stage_id as {{ dbt_utils.type_string() }}) as deal_pipeline_stage_id
from macro

)
Expand Down

0 comments on commit 7be0e29

Please sign in to comment.