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

Ticket models are not created #76

Closed
2 of 4 tasks
moseleyi opened this issue Aug 5, 2022 · 15 comments
Closed
2 of 4 tasks

Ticket models are not created #76

moseleyi opened this issue Aug 5, 2022 · 15 comments
Labels
type:bug Something is broken or incorrect

Comments

@moseleyi
Copy link

moseleyi commented Aug 5, 2022

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.
@moseleyi moseleyi added the bug label Aug 5, 2022
@fivetran-joemarkiewicz
Copy link
Contributor

Hi @moseleyi thanks so much for opening this issue!

Luckily there is a quick fix for you to get the ticket models created in your next run. You can simple set the hubspot_service_enabled variable to be true (it is false by default).

vars:
   hubspot_service_enabled: true

While this is a quick fix, we did not do a good job documenting in the README that this variable is used for the ticket models. I noticed you are open to creating a PR! This would be a great documentation update PR if you are willing to tackle it. I would recommend we simply adjust our wording in the Disable Models section to explicitly state that this variable is used for the ticket models. Similarly, we would want to make the same adjustment in our dbt_hubspot package to be consistent with the documentation.

Let me know if you would be interested in addressing this PR. Otherwise, our team will be able to address this in our next sprint. Additionally, please let me know if setting the variable fixes your initial problem, if not we will want to look more into that 😄

@moseleyi
Copy link
Author

Hi,

I added hubspot_service_enabled: true like you suggested but now I'm getting this error:

06:42:07  Database Error in model stg_hubspot__ticket_deal_tmp (models/tmp/stg_hubspot__ticket_deal_tmp.sql)�
06:42:07    002003 (42S02): SQL compilation error:
06:42:07    Object 'FIVETRAN.HUBSPOT.TICKET_DEAL' does not exist or not authorized.
06:42:07    compiled SQL at target/run/hubspot_source/models/tmp/stg_hubspot__ticket_deal_tmp.sql

I'm guessing it's because we never used the connection between tickets and deals but it shouldn't stop the package from creating basic ticket models, that are independent of Deals, should it?

@fivetran-jamie
Copy link
Contributor

Hi @moseleyi -- can you confirm that the ticket_deal table doesn't exist in your warehouse? if that's indeed the case, I am thinking we should introduce a hubspot_ticket_deal_enabled variable to disable its corresponding models

@moseleyi
Copy link
Author

Fivetran does have it selected but the table isn't built, which I'm guessing suggests that it hasn't been used in Hubspot. Probably because when we used tickets, we never used to join them with Deals.
image

@fivetran-jamie
Copy link
Contributor

hey @moseleyi i've added a hubspot_ticket_deal_enabled variable that's false by default, this should let you just bypass these models since you don't have the ticket_deal source table (which most people don't)

if you'd like to try it out:

packages:
  - git: https://github.com/fivetran/dbt_hubspot_source.git
    revision: feature/disable-ticket-deal
    warn-unpinned: false

@moseleyi
Copy link
Author

hmm is this not going to clash with the fivetran/hubspot package since it already has a hubspot_source dependency?

@fivetran-jamie
Copy link
Contributor

ah yeah -- lemme change the hubspot bugfix/deleted-stages branch to refer to this feature/disable-ticket-deal branch of the source package, so you can test both with that one package reference

@fivetran-jamie
Copy link
Contributor

fivetran-jamie commented Aug 19, 2022

ok the transform package should reference this branch, so you can remove the dbt_hubspot_source package reference from your packages.yml

@moseleyi
Copy link
Author

moseleyi commented Aug 22, 2022

I ran the dbt deps

image

and I have this:

  hubspot_service_enabled: true
  hubspot_ticket_deal_enabled: false

And the ticket deal doesn't show an error anymore. What tables should I see for tickets? I can see the stg_ views but not the ticket-related tables

@fivetran-jamie
Copy link
Contributor

like no ticket-related staging models are showing up? that would mean it's not capturing that you have the hubspot_service_enabled var set to true 🤔

@moseleyi
Copy link
Author

moseleyi commented Aug 23, 2022

STaging views are created:

image

but no actual ticket-related materialised tables

@fivetran-jamie
Copy link
Contributor

ah by ticket-related materialised tables do you mean transform models? if so, the transform package actually doesn't do anything with tickets -- the source package just creates staging models for them

@fivetran-jamie
Copy link
Contributor

or rather do you mean you'd want these views materialized as tables?

@moseleyi
Copy link
Author

Ahh okay, I thought tables would also be built automatically like for others but I see it's not in the hubspot package

@fivetran-joemarkiewicz
Copy link
Contributor

Closing this issue as it has since been resolved.

@fivetran-sheringuyen fivetran-sheringuyen added type:bug Something is broken or incorrect and removed bug labels Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something is broken or incorrect
Projects
None yet
Development

No branches or pull requests

4 participants