fivetran / dbt_hubspot_source

Data models for Hubspot built using dbt.
https://fivetran.github.io/dbt_hubspot_source/
Apache License 2.0
31 stars 30 forks source link

[Bug] Extra comma causing compile issues in stg_hubspot__ticket #121

Closed marshallbroussard closed 9 months ago

marshallbroussard commented 10 months ago

Is there an existing issue for this?

Describe the issue

Line 32 of stg_hubspot__ticket begins with a comma, however the remove_duplicate_and_prefix_from_columns macro also begins each line with a comma, resulting in a SQL compilation error. All other uses of this macro follow another pattern, though it should make for the same result. The other pattern does not include an additional comma between the fivetran_utils.fill_staging_columns and the remove_duplciate_and_prefix_from_columns macro calls.

Relevant error log or model output

00:26:45    Database Error in model stg_hubspot__ticket (models\stg_hubspot__ticket.sql)
  001003 (42000): SQL compilation error:
  syntax error line 169 at position 8 unexpected ','.
  compiled Code at target\run\hubspot_source\models\stg_hubspot__ticket.sql
00:26:45
00:26:45  Done. PASS=1 WARN=0 ERROR=1 SKIP=0 TOTAL=2


### Expected behavior

The models should be composed with valid SQL, passing through all columns from hubspot.

### dbt Project configurations

`hubspot__pass_through_all_columns: true`

### Package versions

0.14.0

### What database are you using dbt with?

snowflake

### dbt Version

Core 1.7.1
Snowflake 1.7.0

### Additional Context

_No response_

### Are you willing to open a PR to help address this issue?

- [X] Yes.
- [ ] Yes, but I will need assistance and will schedule time during our [office hours](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) for guidance
- [ ] No.
fivetran-catfritz commented 10 months ago

Hi @marshallbroussard, thanks for opening this issue and bringing this issue to our attention. Also thank you much for digging into the code and finding the source of the issue! I am currently working on a few updates for this package, so I will definitely roll this fix in with my current batch.

fivetran-catfritz commented 10 months ago

Hi @marshallbroussard, I have created a test branch for our next release of dbt_hubspot that should resolve this issue. You can install it by using the below snippet in your packages.yml in place of your normal hubspot lines.

- git: https://github.com/fivetran/dbt_hubspot.git
  revision: release/v0.15.0
  warn-unpinned: false

Please let me know your feedback if you are able to try it out!

fivetran-catfritz commented 9 months ago

This update has been released in the latest version, so closing this issue out!