Closed scotthibberd closed 2 years ago
Thanks for opening this @scotthibberd!
This is a fix we most likely would want to apply to the package. However, we would want to do it a bit differently than the fix you shared to make it dynamic for users using this package on other warehouses.
What we would want to do is cast the fields within the dbt_hubspot_source
package and then apply the left join as you have shown, but without the casting. For example, we would cast deal_pipeline_id
in the staging model to be the following:
cast(pipeline_id as {{ dbt_utils.type_int() }}) as deal_pipeline_id
This way the casting will be appropriate for users that are not on Redshift as well. Let me know if this makes sense. In the meantime, feel free to open a PR to adjust the joins in this package and I can update the source to cast appropriately, or I can open both PRs by the end of this week. Similarly, let me know if you would like to open the PRs for both and I can review! 😄
That makes sense in terms of making the fix more dynamic. Please could you open the PRs for that?
Thanks for your help.
Hi @scotthibberd I have been able to open the above noted PRs to apply this quick fix.
I actually found that we should be casting these fields to a string type since the IDs in my data are not consistently integers. Regardless, I was able to apply the fixes and have found the package to compile and run as intended locally. Before I open my PR for review and merge any changes, it would be great if you could give the below version of the package a try. You can simply remove the package dependency in your packages.yml
and use the below config:
FYI if you have the
hubspot_source
package as a depenency, you will want to remove that as well for the branch to work as intended.packages: - git: https://github.com/fivetran/dbt_hubspot.git revision: bugfix/casting-and-joins warn-unpinned: false
Let me know how the working branch goes!
Amazing - thanks @fivetran-joemarkiewicz ! I've just tested it and that's working for me now.
@scotthibberd these updates are now live in the latest versions of the hubspot package. Thanks so much for raising this issue.
I will close this issue, but please feel free to open a new issue if you encounter and other questions or errors.
Are you a current Fivetran customer? Yes. Scott Hibberd - Infogrid, BI Analyst
Describe the bug Running
dbt run
returns an error for thehubspot__deals
andhubspot__deal_stages
modelsThe error I receive is
JOIN/USING types bigint and character varying cannot be matched
Steps to reproduce
dbt run
Expected behavior Models should build without error
Project variables configuration
Package Version
Warehouse
Additional context For both models, the build fails due to the join within the
deal_fields_joined
CTEIt fixes for me to rewrite the join as follow:
Screenshots
Please indicate the level of urgency Currently in the process of building Hubspot reporting - we can workaround temporarily by overwriting the package model files, but a longer term solution is preferable.
Are you interested in contributing to this package?