Skip to content
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

introduce category field upstream #150

Merged
merged 17 commits into from
Nov 11, 2024
Merged

Conversation

fivetran-reneeli
Copy link
Contributor

@fivetran-reneeli fivetran-reneeli commented Nov 4, 2024

PR Overview

This PR will address the following Issue/Feature:
#131 , and internal ticket (see upstream PR for most changes)

This PR will result in the following new package version:

v0.20.0

Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:

Breaking Change (--full-refresh required after upgrading)

  • Introduced the new category column to certain upstream models and added to relevant unique tests. This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the connector in October 2024. For more information, refer to the upstream CHANGELOG

  • This will be a breaking change and will require a --full-refresh.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt run –full-refresh && dbt test
  • [na] dbt run (if incremental models are present) && dbt test

Before marking this PR as "ready for review" the following have been applied:

  • [na] The appropriate issue has been linked, tagged, and properly assigned
  • All necessary documentation and version upgrades have been applied
  • docs were regenerated (unless this PR does not include any code or yml updates)
  • BuildKite integration tests are passing
  • [ba] Detailed validation steps have been provided below

Detailed Validation

Please share any and all of your validation steps:

Will have customer confirm this branch allows their tests to pass

If you had to summarize this PR in an emoji, which would it be?

💃

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli thanks for working through these changes so quickly! A few requests to go along with this PR in addition to the below review notes:

  • Please replicate the seed file updates you made in the source PR and add them here so we can ensure we are including the new fields in our testing of the transform package.
  • I noticed that some of those staging models flow downstream to end models. It doesn't look like the category field automatically flows down into the end table provided fields; however, should we consider these fields in the end models? I don't know if this is required, but given the uniqueness tests were failing in the staging models once these fields were added, do we need to consider these in any filters or joins in the transform package?

CHANGELOG.md Outdated
[PR #150](https://github.com/fivetran/dbt_hubspot/pull/150) includes the following updates:

## Breaking Change (`--full-refresh` required after upgrading)
- Introduced the new `category` column to certain upstream models and added to relevant unique tests. This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the connector in October 2024. For more information, refer to the upstream [CHANGELOG](https://github.com/fivetran/dbt_hubspot_source/releases/tag/v0.17.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's exhaustive, but can you include essentially the entire breaking change note from the source CHANGELOG to be here as well. We can still link to the source release notes, but since this is what is rendered in the Quickstart UI, it would be great to show all relevant breaking changes here without requiring the customer to click through a new link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob, that makes sense! added the note from source in its entirety

CHANGELOG.md Outdated
## Breaking Change (`--full-refresh` required after upgrading)
- Introduced the new `category` column to certain upstream models and added to relevant unique tests. This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the connector in October 2024. For more information, refer to the upstream [CHANGELOG](https://github.com/fivetran/dbt_hubspot_source/releases/tag/v0.17.0)

- This will be a breaking change and will require a `--full-refresh`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove this since we already mention it in the title header.

packages.yml Outdated
Comment on lines 2 to 7
# - package: fivetran/hubspot_source
# version: [">=0.17.0", "<0.18.0"]

- git: https://github.com/fivetran/dbt_hubspot_source.git
revision: bugfix/category_add
warn-unpinned: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to swap before release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the above.

@fivetran-reneeli
Copy link
Contributor Author

Thanks @fivetran-joemarkiewicz , updated the seed files and applied the rest of changes.

I will ask the customer about downstream implications as per our internal discussion.

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a few notes to address before release review, but no reason to block approval

CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines 17 to 26
hubspot_service_enabled: true # enable when generating docs
hubspot_deal_enabled: true # enable when generating docs
hubspot_contact_enabled: true # enable when generating docs
hubspot_sales_enabled: true # enable when generating docs
hubspot_company_enabled: true # enable when generating docs
hubspot_marketing_enabled: true # enable when generating docs
hubspot_contact_merge_audit_enabled: true # enable when generating docs
hubspot_using_all_email_events: true # enable when generating docs
hubspot_merged_deal_enabled: true # enable when generating docs
hubspot_ticket_deal_enabled: true # enable when generating docs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable before merging

Comment on lines 1 to 15
9089908390,9014070905,2023-06-22 11:37:07.210000,HUBSPOT_DEFINED
9089908390,9077310858,2023-06-22 11:37:07.210000,HUBSPOT_DEFINED
9089908390,9077311778,2023-06-22 11:37:07.210000,HUBSPOT_DEFINED
9089908390,9014071335,2023-06-22 11:37:07.210000,HUBSPOT_DEFINED
1364146343,10829010820,2023-06-22 11:37:07.220000,HUBSPOT_DEFINED
1364146343,10828874842,2023-06-22 11:37:07.220000,HUBSPOT_DEFINED
1368273549,10829051678,2023-06-22 11:37:07.227000,HUBSPOT_DEFINED
1368273549,10829028256,2023-06-22 11:37:07.227000,HUBSPOT_DEFINED
1373595330,10879517198,2023-06-22 11:37:07.227000,HUBSPOT_DEFINED
1373595330,10828874855,2023-06-22 11:37:07.227000,HUBSPOT_DEFINED
1006463008,10064581040,2023-06-22 11:37:07.213000,HUBSPOT_DEFINED
1006463008,9351825260,2023-06-22 11:37:07.213000,HUBSPOT_DEFINED
1389291069,12351788138,2023-06-28 11:18:32.940000,HUBSPOT_DEFINED
1389291069,13817889862,2023-06-28 11:18:32.939000,HUBSPOT_DEFINED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe the category field is necessary here as it isn't in the source data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed! thank you

packages.yml Outdated
Comment on lines 2 to 7
# - package: fivetran/hubspot_source
# version: [">=0.17.0", "<0.18.0"]

- git: https://github.com/fivetran/dbt_hubspot_source.git
revision: bugfix/category_add
warn-unpinned: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the above.

CHANGELOG.md Outdated
# dbt_hubspot v0.20.0
[PR #150](https://github.com/fivetran/dbt_hubspot/pull/150) includes the following updates:

## Breaking Change (`--full-refresh` required after upgrading)
Copy link
Contributor

@fivetran-avinash fivetran-avinash Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These breaking changes are occurring in dbt_hubspot_source. We should call that out here as Upstream Breaking Changes and link to the dbt_hubspot_source release notes or changelog. You could use this PR you previously wrote for an upstream change as an example for how to reword it (i.e.
"because new columns are being added to this staging models, a --full-refresh is needed to access them"), and also link to the dbt_hubspot_source CHANGELOG section or release notes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird, this got separated out in the PR notes. Apologies.

Highly recommend making these updates, as it isn't quite clear from this CHANGELOG that these changes are being made in the source.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah thanks Avinash sorry to not catch this! just updated, lmk what you think

Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli Some comments before approval!

_fivetran_synced: timestamp
property_closedate: timestamp
property_createdate: timestamp
deal_pipeline_id: "{{ 'varchar(100)' if target.type in ('redshift','postgres') else 'string'}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like lines 111-112 were not added in the dbt_hubspot_source integration_tests/dbt_project.yml, we should probably add them there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right that was added in the transforms because buildkite was failing in this package. but yes added it to hubspot_source

@@ -172,6 +181,7 @@ seeds:
deal_pipeline_stage_data:
+column_types:
stage_id: "{{ 'varchar(100)' if target.type in ('redshift','postgres') else 'string'}}"
pipeline_id: "{{ 'varchar(100)' if target.type in ('redshift','postgres') else 'string'}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this line was not added in the dbt_hubspot_source integration_tests/dbt_project.yml, we should probably add them there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for noticing these!

@@ -137,6 +145,7 @@ seeds:
+column_types:
engagement_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
deal_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
created_at: timestamp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably add this in integration_tests/dbt_project.yml in the dbt_hubspot_source package as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

CHANGELOG.md Outdated
- `stg_hubspot__ticket_engagement`

## Under the Hood
- Updated the respective seed files in the integration_tests folder to property test for the new `category` field.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you also updated seed files as well to match the dbt_hubspot_source package for consistency's sake. Might be worth calling it out!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks updated!

Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli
Copy link
Contributor Author

@fivetran-reneeli Looks like my major comment note got separated out from the initial PR. If you can address that, then this is good to go!

Thanks @fivetran-avinash I updated the CHANGELOG. Let me know what you think

[PR #150](https://github.com/fivetran/dbt_hubspot/pull/150) includes the following updates:

## Upstream Breaking Changes (`--full-refresh` required after upgrading)
- Introduced a new `category` column to the following upstream models (see dbt_hubspot_source [CHANGELOG](https://github.com/fivetran/dbt_hubspot_source/blob/main/CHANGELOG.md#dbt_hubspot_source-v0170) notes). This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the Hubspot connector in October 2024. See the [connector release notes](https://fivetran.com/docs/connectors/applications/hubspot/changelog#october2024) for more.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Introduced a new `category` column to the following upstream models (see dbt_hubspot_source [CHANGELOG](https://github.com/fivetran/dbt_hubspot_source/blob/main/CHANGELOG.md#dbt_hubspot_source-v0170) notes). This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the Hubspot connector in October 2024. See the [connector release notes](https://fivetran.com/docs/connectors/applications/hubspot/changelog#october2024) for more.
- Introduced a new `category` column to the following upstream models (see `dbt_hubspot_source` [CHANGELOG](https://github.com/fivetran/dbt_hubspot_source/blob/main/CHANGELOG.md#dbt_hubspot_source-v0170) notes). This association field differentiates records by either HUBSPOT_DEFINED (default label) or USER_DEFINED (custom label) and was introduced to the Hubspot connector in October 2024. See the [connector release notes](https://fivetran.com/docs/connectors/applications/hubspot/changelog#october2024) for more.

Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-reneeli Thanks for bearing all these comments! This is approved now.

One small comment, plus one suggestion: Can you update the title of this PR to describe what the PR is doing? I think for some reason it's taking the title of your commit.

@fivetran-reneeli fivetran-reneeli changed the title versioning introduce category field upstream Nov 11, 2024
@fivetran-reneeli
Copy link
Contributor Author

@fivetran-reneeli Thanks for bearing all these comments! This is approved now.

One small comment, plus one suggestion: Can you update the title of this PR to describe what the PR is doing? I think for some reason it's taking the title of your commit.

Thanks for noticing that! Appreciate the review!

@fivetran-reneeli fivetran-reneeli merged commit 069d9ac into main Nov 11, 2024
9 checks passed
@fivetran-reneeli fivetran-reneeli deleted the bugfix/category_add branch November 11, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants