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

Add new category field #132

Merged
merged 23 commits into from
Nov 11, 2024
Merged

Add new category field #132

merged 23 commits into from
Nov 11, 2024

Conversation

fivetran-reneeli
Copy link
Contributor

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

PR Overview

This PR will address the following Issue/Feature:
#131 , and internal ticket

This PR will result in the following new package version:

v0.17.0

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

Breaking Change

  • Introduced a new category column to the below models. 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.

    • stg_hubspot__deal_company
    • stg_hubspot__deal_contact
    • stg_hubspot__merged_deal
    • stg_hubspot__engagement_company
    • stg_hubspot__engagement_contact
    • stg_hubspot__engagement_deal
    • stg_hubspot__ticket_company
    • stg_hubspot__ticket_contact
    • stg_hubspot__ticket_deal
    • stg_hubspot__ticket_engagement
  • The category field which will be a part of the uniqueness tests for the following models:

    • stg_hubspot__deal_contact
    • stg_hubspot__deal_company

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
  • 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 this PR. I have a few comments and suggestions before this is ready for approval. Great to see the customer mentioned this addressed the immediate issue in the linked bug report!

integration_tests/dbt_project.yml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize these probably aren't a result of the changes from this PR, but I noticed there are some dbt seed warnings in the BK runs produced from these seed files.
image

Would you be able to inspect these and make sure the warnings/errors are resolved in this release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looked into this. property_hs_createdate doesn't exist in our engagement_meeting seed data so I removed it from the config.

But I saw some like the below:
image

And I couldn't figure out where the error was coming from because I don't see property_hs_createdate being referenced for email_event_spam_report_data anywhere...

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 one note to address before moving to release review. No reason to block initial approval.

@@ -3,7 +3,8 @@
{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
{"name": "deal_id", "datatype": dbt.type_int()},
{"name": "merged_deal_id", "datatype": dbt.type_int()}
{"name": "merged_deal_id", "datatype": dbt.type_int()},
{"name": "category", "datatype": dbt.type_string()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Category is not included in merged_deal so we should remove here 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.

thanks for catching!

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 Had a few questions!

- Introduced a new `category` column to the below models. 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.
- `stg_hubspot__deal_company`
- `stg_hubspot__deal_contact`
- `stg_hubspot__engagement_company`
Copy link
Contributor

Choose a reason for hiding this comment

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

@fivetran-reneeli I do not see the category column added to any of the models from lines 7-13. Was the intention to add category to these models, or should these lines be removed?

Copy link
Contributor Author

@fivetran-reneeli fivetran-reneeli Nov 11, 2024

Choose a reason for hiding this comment

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

Great question! So these models leverage a macro to bring through all the columns and therefore the category field was not explicitly called out in them, thus the models themselves didn't require any changes. But you can see that the new field gets brought through after running the package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah makes sense! Thanks for that.

CHANGELOG.md Outdated

## Under the Hood
- Updated the respective seed files, `get_[source_table]_column` macros, and documentation of the mentioned models to include the `category` field.
- Added explicit casting of `pipeline_id` to string in `stg_hubspot__deal_pipeline_stage` to ensure successful downstream joins.
Copy link
Contributor

Choose a reason for hiding this comment

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

@fivetran-reneeli If this could potentially change the data type, wouldn't this be a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, moved to the Breaking Change section

@@ -1,3 +1,26 @@
# dbt_hubspot_source 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.

Could you bump the README version up to [">=0.17.0", "<0.18.0"]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you!

@@ -146,8 +147,6 @@ seeds:
+column_types:
engagement_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
_fivetran_synced: timestamp
property_hs_createdate: timestamp
Copy link
Contributor

Choose a reason for hiding this comment

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

was there a reason this casting was removed for these fields? it wasn't called out in the CHANGELOG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I had realized that these fields were not existent in the seed data and therefore not necessary. I'll call this out in the Under the Hood section too

CHANGELOG.md Outdated Show resolved Hide resolved
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 One small suggestion but after Buildkite passes you're good to merge!

Co-authored-by: Avinash Kunnath <108772760+fivetran-avinash@users.noreply.github.com>
@fivetran-reneeli fivetran-reneeli merged commit c80c6e7 into main Nov 11, 2024
8 checks passed
@fivetran-reneeli fivetran-reneeli deleted the bugfix/category_add branch November 11, 2024 17:30
@fivetran-reneeli fivetran-reneeli linked an issue Nov 12, 2024 that may be closed by this pull request
4 tasks
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.

[Feature] Support for new association type composite keys
3 participants