-
Notifications
You must be signed in to change notification settings - Fork 39
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
Deal stage updates #37
Conversation
Co-authored-by: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com>
description: The unique deal stage identifier. | ||
tests: | ||
- not_null | ||
- unique |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this might not always pass since we're pulling in deal_company
, which has a 1:n relationship
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we shouldn't bring the company into the deal_stages
model, which is what we decided with hubspot__deals
(and users can just join with deal_company
and company
using the staging models)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I forgot about that issue. That is a great point. I will remove the deal_company and refer the customer that they can simply join company in if they would like. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @fivetran-jamie and @fivetran-joemarkiewicz,
I dug through the documentation of dbt_hubspot
as well as dbt_hubspot_source
's but saw nothing about "simply joining company" as per the last comment here. How would you go about including the company_id
in hubspot_deals
without adding a custom field on Hubspot or having to build a child table only to join deal_company
?
Thanks for your help, and thanks for this incredible package!
Edit:
This is what I ended up doing! Works like a charm. Is this the kind of thing you had in mind when you wrote about "refering the customer" ? I feel like it could be a great addition to the README, and would be happy to open a PR if need be.
-- models/marts/facts/hubspot__deal_company.sql
{{ config(schema='hubspot') }}
SELECT * FROM {{ source('hubspot', 'deal_company') }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @coisnepe the deal_company
model does exist within the source package as a staging model (stg_hubspot__deal_comapny). @fivetran-jamie was referring to using this staging model to join in the company information to the deal_stages model. If you leverage this, I believe would you achieve the same results.
Let me know if this works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks mostly good! left a comment regarding the hubspot__deal_stages PK
Co-authored-by: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com>
…hubspot into deal_stage-updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for you regarding modeling. All other files look good.
@@ -0,0 +1,63 @@ | |||
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought here ---
Why did you choose this approach, rather than joining the new deal_stage model to the final hubspot__deals
model? Seems like we're doing a lot of duplicative work in this model, but I may be missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right this is duplicative work. The only difference is the inclusion of the pipeline.is_active
which is not in the hubspot__deals
model. I will add that field to the hubspot__deals
model to make this a cleaner model and remove duplicative code. Thanks!
When updating the As such, to accommodate for this and produce cleaner code I decided to create an intermediate model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
This PR includes the following updates:
hubspot__deal_stage
final model as requested within Issue Feature Request - Deal_stage modeling #30hubspot_deal_company_enabled
variable