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

update macro used for passing through all columns to ensure quoting #129

Merged
merged 30 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e40bb44
updates apply
fivetran-reneeli Oct 4, 2024
dc38bc4
rm the test field in seed data since not all warehouses like the syntax
fivetran-reneeli Oct 4, 2024
d5198a5
docs
fivetran-reneeli Oct 4, 2024
b047a69
new schema
fivetran-reneeli Oct 4, 2024
896498b
try to adapt add pass through column macro
fivetran-reneeli Oct 8, 2024
fb9ee19
adjust add pass through macro
fivetran-reneeli Oct 8, 2024
6886a74
Update macros/hubspot_add_pass_through_columns.sql
fivetran-reneeli Oct 9, 2024
a56799f
use custom hubspot pass thru columns, add company seed data for postg…
fivetran-reneeli Oct 9, 2024
fa09f4a
docs
fivetran-reneeli Oct 9, 2024
1ed3424
add databricks and snowflake seed, adjust configs
fivetran-reneeli Oct 9, 2024
403cf3a
disable
fivetran-reneeli Oct 9, 2024
e08ad5a
change schema
fivetran-reneeli Oct 9, 2024
16cd3dc
new schema
fivetran-reneeli Oct 10, 2024
5d8d1bb
column type config fix
fivetran-reneeli Oct 10, 2024
81e26f2
new schema
fivetran-reneeli Oct 10, 2024
77c4261
rm the hubspot_source prefix
fivetran-reneeli Oct 10, 2024
6742939
new schema
fivetran-reneeli Oct 10, 2024
afa5879
Update CHANGELOG.md
fivetran-reneeli Oct 15, 2024
ea99532
Update CHANGELOG.md
fivetran-reneeli Oct 15, 2024
bd58f38
update versioning and some docs
fivetran-reneeli Oct 15, 2024
900fdc9
more updates
fivetran-reneeli Oct 15, 2024
c7819c9
new schema
fivetran-reneeli Oct 15, 2024
e34eded
docs
fivetran-reneeli Oct 15, 2024
bdccd3d
rm validation test config from source
fivetran-reneeli Oct 15, 2024
019f8e3
new schema
fivetran-reneeli Oct 15, 2024
00c6305
fix databricks seed error?
fivetran-reneeli Oct 15, 2024
caca80b
try again
fivetran-reneeli Oct 16, 2024
ab9a102
Update CHANGELOG.md
fivetran-reneeli Oct 16, 2024
5bf7c7d
changelog updates
fivetran-reneeli Oct 16, 2024
1169162
quote some test configs
fivetran-reneeli Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# dbt_hubspot_source v0.15.1
[PR #129](https://github.com/fivetran/dbt_hubspot_source/pull/129) includes the following updates:
## Bugfix
- Switched from using the `fivetran_utils.remove_prefix_from_columns` macro to the `hubspot_source.remove_duplicate_and_prefix_from_columns` macro for when `hubspot__pass_through_all_columns` is enabled and you are passing through all columns in the `stg_hubspot__company`, `stg_hubspot__contact`, `stg_hubspot__deal`.

fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
# dbt_hubspot_source v0.15.0
[PR #126](https://github.com/fivetran/dbt_hubspot_source/pull/126) includes the following updates:

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot_source'
version: '0.15.0'
version: '0.15.1'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/run_results.json

This file was deleted.

10 changes: 5 additions & 5 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ integration_tests:
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
port: 5439
schema: hubspot_source_integration_tests_21
schema: hubspot_source_integration_tests_22
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: hubspot_source_integration_tests_21
schema: hubspot_source_integration_tests_22
threads: 8
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
snowflake:
Expand All @@ -33,7 +33,7 @@ integration_tests:
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
schema: hubspot_source_integration_tests_21
schema: hubspot_source_integration_tests_22
threads: 8
postgres:
type: postgres
Expand All @@ -42,13 +42,13 @@ integration_tests:
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
port: 5432
schema: hubspot_source_integration_tests_21
schema: hubspot_source_integration_tests_22
threads: 8
databricks:
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: hubspot_source_integration_tests_21
schema: hubspot_source_integration_tests_22
threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
Expand Down
10 changes: 8 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot_source_integration_tests'
version: '0.15.0'
version: '0.15.1'
profile: 'integration_tests'
config-version: 2

Expand All @@ -8,7 +8,7 @@ models:
# +schema: "hubspot_{{ var('directed_schema','dev') }}" ## To be used for validation testing

vars:
hubspot_schema: hubspot_source_integration_tests_21
hubspot_schema: hubspot_source_integration_tests_22
hubspot_source:
hubspot_service_enabled: true
# hubspot_sales_enabled: true # enable when generating docs
Expand Down Expand Up @@ -65,6 +65,12 @@ vars:
hubspot_email_event_dropped_identifier: "email_event_dropped_data"
hubspot_merged_deal_identifier: "merged_deal_data"

# hubspot__pass_through_all_columns: true
hubspot__company_pass_through_columns:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should lines 71-73 be commented out now (or completely removed) now that we've thoroughly tested and validated this solution works, or is there a reason for keeping them in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No particular reason for keeping them in-- will comment it out

- name: "property_hs_all-funky-a9384-syntax"
alias: "funky_field"


seeds:
hubspot_source_integration_tests:
+quote_columns: "{{ true if target.type == 'redshift' else false }}"
Expand Down
50 changes: 25 additions & 25 deletions integration_tests/seeds/company_data.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
id,is_deleted,_fivetran_synced,property_name,property_description,property_createdate,property_industry,property_address,property_address_2,property_city,property_state,property_country,property_annualrevenue
2182162682,false,2020-12-30 3:15:52,4b2c13cca3eb58ee49bbddcf00417130,0f478ed365082ae132c370744c96790e,2019-07-05 20:35:26,37a6259cc0c1dae299a7866489dff0bd,6cb5c4eeb3599d4201118f569157c95b,37a6259cc0c1dae299a7866489dff0bd,,XX,United States,10000000
2319384765,false,2020-12-30 3:15:53,205020e0c4a91e8ee3f36b068dee85d3,60b8a67a7dbada5edc7639304bd3d9c2,2019-08-12 15:38:30,37a6259cc0c1dae299a7866489dff0bd,0928d268e6a6802df980208759313326,3d5b3c2fe48975cd1afc0fe69d2ac28b,1046ecca1bf740bddd6fb8d780795314,XX,United States,10000000
2539352677,false,2020-12-30 4:16:24,fafc347400679e25e47860b0d74d0d48,d4e9c03ef85c2e7952b28198eef04410,2019-10-29 10:00:41,4835236f5484f4ce65c05aaac3bd5297,a1ecccfdd09bf7b66cb7b9e06de4e680,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000
2258956513,false,2020-12-30 4:16:23,06a77d6464bc6d5404513281a55f69d2,751bc1dafa963237e06c0f69f1cf23d6,2019-07-29 17:54:22,d471cfef4b5766cab06c98616c6e4c12,692a1af299911a0b74907c99c796ef81,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United Kingdom,10000000
858780924,false,2020-12-30 4:16:23,8d4cacc32973fa43806d6e743a315e90,7cc08a5696f7385f44b085addd439255,2018-07-11 20:53:41,37a6259cc0c1dae299a7866489dff0bd,0e59ca4fcd625a9e8cbcaef12e52a29d,37a6259cc0c1dae299a7866489dff0bd,538f6af1d2490971ef1ccfa44b11e49c,XX,United States,10000000
2050238876,false,2020-12-30 4:16:22,fd845fa89c0f4541437564a0d4a83db1,a966d2c4f4a432623f710043a0a9f814,2019-05-23 12:37:25,37a6259cc0c1dae299a7866489dff0bd,3f5794cc394b2f88cdcac4b04fa1a68e,19e93bb1ceb58937019c5e8bbd02901d,32ce3f1410510651a5f862f64e137868,XX,United States,10000000
2426544794,false,2020-12-30 3:15:52,9b1d5c6d91c9abcb04b3a6125152d177,41b60e9f786fd88c706129dd478fb713,2019-09-19 18:08:42,37a6259cc0c1dae299a7866489dff0bd,7af8dcc119f9f2dbffc67bb47fc432a8,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000
2568965709,false,2020-12-30 4:16:21,40afc385ed39ff1a890b09aa05853446,35c9aa14cd59eea7550e94bd01b8ed45,2019-11-09 21:05:19,fdc8c08a76b5f12553dc839b8924f0df,8f76e1a2370a4b0a61c65fcad235ae69,37a6259cc0c1dae299a7866489dff0bd,0d66d119a9a135af72195d2c3ca7fce3,XX,United States,10000000
2412860846,false,2020-12-30 4:16:20,668fdfbd0e9af92ea4eaf05fabddc3db,d41d8cd98f00b204e9800998ecf8427e,2019-09-15 2:50:54,8ca443b7a43b9681d196a55f8d090e62,2fdd9c57430a26cc45b67ba5222a9172,37a6259cc0c1dae299a7866489dff0bd,08d9eaf148bca47f7fd699c606e4558e,XX,United States,10000000
2172830982,false,2020-12-30 4:16:22,ea1f5fc85bc26ed0284a6ac983a50fa8,25cf0f84ed5240a781f1fae5a4a15e6e,2019-07-02 22:48:57,87512a2bed0bf5045b31244650d4dce4,1c0bde7cc4b2af8e7d3c09ae152e8ebb,37a6259cc0c1dae299a7866489dff0bd,d41d8cd98f00b204e9800998ecf8427e,XX,United States,10000000
2436861098,false,2021-01-08 19:16:04,9b24a2dd46e664c5cbdcc015ab926921,b08d4d22fe821cf682878489fbd0b990,2019-09-24 18:47:58,b755ecacb563d4689aa5ce826cb358b2,89b5a06bb493df9f9f1c09795c0c8152,37a6259cc0c1dae299a7866489dff0bd,40097d120d9885baa23e22ee3c1fb509,XX,United States,10000000
1875804727,false,2021-01-01 1:15:54,76d284a57e820e5352fed186b2bb49cb,9dd3e7102bdbfa45fac1a4e0a89be7f3,2019-05-01 11:46:34,3e549b5e426932c7c8be79851c800d33,bab5e0044f4c4accb048cfcbc646ea97,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000
1755751861,false,2021-01-01 20:15:54,ae52b283b310874855392edad9860f1b,5aec0f1d3c77e8fde09666951cc5960a,2019-03-21 18:44:36,08ded3e3b8d060ebb163f9dd4a2fe847,18bc9940888c7ab60926b62f2606e019,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United Kingdom,10000000
2802517900,false,2020-12-30 4:16:22,05c2cd208f223ed13cf46856f3637369,ad4d0c38c4ffed1631b40c06661ce02d,2020-01-08 2:13:54,37a6259cc0c1dae299a7866489dff0bd,9ac4b85e60c1eb3b26f853bca29e25fe,37a6259cc0c1dae299a7866489dff0bd,59ead8d1e124ccfb79f3ace06f43e703,XX,United States,10000000
2318645267,false,2020-12-30 4:16:19,80b9f7df9b05e9118515093787ab450a,897c7f6ab3be7d330a164102c1c57b84,2019-08-12 11:54:55,37a6259cc0c1dae299a7866489dff0bd,eb15251744565ff877503436b2fbded9,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000
2308842161,false,2020-12-30 4:16:23,23bda4a4a5e92e0b92281434635e001d,89bf926c2515d8dca94e673e685ed3f0,2019-08-08 12:32:54,8ca443b7a43b9681d196a55f8d090e62,920cfa229fed31fa4e7ef91c6ecfc9b4,37a6259cc0c1dae299a7866489dff0bd,f0dddde0d04dc3b9ec79302c612a3fae,XX,United States,10000000
860870157,false,2020-06-26 2:25:42,449aad8808e10090e96d6e3f5da9067e,25884bf2573ae3371dd3194d9a7472ac,2018-07-13 12:55:25,d41d8cd98f00b204e9800998ecf8427e,7d6a756d9535452035490acc4e47db39,37a6259cc0c1dae299a7866489dff0bd,1422ded96c56c5b778bfbd78603dfafd,XX,United States,10000000
2396583124,false,2020-12-30 4:16:22,9b017cf05a4e8e99ab17f775e085c0a8,753dae9ea2b87c5055c32981801ca928,2019-09-10 15:51:15,6796258c8758595c95121cce6706bb96,d2aee195f7fb0a54bc83a81bcaaec890,37a6259cc0c1dae299a7866489dff0bd,04ec30e97b990f9087f5fdad71ba4336,XX,United States,10000000
1771990873,false,2020-12-30 4:16:23,6c1ade589848a6f5b97e27946ec5c790,c0f57d2f61377273ad37df68a1dfc9f9,2019-03-30 1:24:37,67fa9476899309473e77fe4c832035d2,cc3e9116a8c3c6c59d467f602689d7a7,37a6259cc0c1dae299a7866489dff0bd,d1ada0d3ae8ff2720b9a48a608d3d4ae,XX,United States,10000000
2165366027,false,2020-12-30 4:16:24,beee8abdf076860d8049f6b34f87f560,7aec43fa866665673f2e49c802264290,2019-07-01 15:02:38,150b1db2e79cd4b9012c6756b5720e1a,f79d92c5b3c52f5636a3b197b34b18cb,37a6259cc0c1dae299a7866489dff0bd,09ea9b5e69df9e1385463fde29bc41cf,XX,United States,10000000
2453842109,false,2020-12-30 4:16:20,8b7b90c56f36ccfaaf3a1c2e0ce1be5c,71e38b3556f324b7e82d4e728bf84fc3,2019-09-28 23:27:44,37a6259cc0c1dae299a7866489dff0bd,fae086294a1b1da828c0dec9b185259d,37a6259cc0c1dae299a7866489dff0bd,25efc916cf9837e321f5157f8e9fed4c,XX,United States,10000000
2814875518,false,2020-12-30 4:16:23,5b6c46120aeaee12a013d088acde8ecf,e1f23fc586d2dce96d72b8d24b5c61f2,2020-01-10 17:13:01,37a6259cc0c1dae299a7866489dff0bd,95829bb5cb0436f1513dfb18678eadfd,37a6259cc0c1dae299a7866489dff0bd,9cfa1e69f507d007a516eb3e9f5074e2,XX,United States,10000000
2759780517,false,2020-12-30 4:16:20,685012b2729f6a580c6620f0a5192e8d,e1e4464aae529785549615b5e53f8c3a,2019-12-27 20:19:25,d41d8cd98f00b204e9800998ecf8427e,88957c6c21a2bc52a54880f22002c3db,37a6259cc0c1dae299a7866489dff0bd,c17ba32b360562102687b5ac3f122692,XX,United States,10000000
2402736100,false,2020-12-30 4:16:23,29ffbc5b6f1e85c758b08acc61e586b0,d86afee1071e0be83e787857d1c67a47,2019-09-11 16:59:48,d41d8cd98f00b204e9800998ecf8427e,dcdcdfa2e85d945e97fa72b2da9affbc,37a6259cc0c1dae299a7866489dff0bd,25efc916cf9837e321f5157f8e9fed4c,XX,United States,10000000
id,is_deleted,_fivetran_synced,property_name,property_description,property_createdate,property_industry,property_address,property_address_2,property_city,property_state,property_country,property_annualrevenue,property_hs_all-funky-a9384-syntax
2182162682,false,2020-12-30 3:15:52,4b2c13cca3eb58ee49bbddcf00417130,0f478ed365082ae132c370744c96790e,2019-07-05 20:35:26,37a6259cc0c1dae299a7866489dff0bd,6cb5c4eeb3599d4201118f569157c95b,37a6259cc0c1dae299a7866489dff0bd,,XX,United States,10000000,23
2319384765,false,2020-12-30 3:15:53,205020e0c4a91e8ee3f36b068dee85d3,60b8a67a7dbada5edc7639304bd3d9c2,2019-08-12 15:38:30,37a6259cc0c1dae299a7866489dff0bd,0928d268e6a6802df980208759313326,3d5b3c2fe48975cd1afc0fe69d2ac28b,1046ecca1bf740bddd6fb8d780795314,XX,United States,10000000,
2539352677,false,2020-12-30 4:16:24,fafc347400679e25e47860b0d74d0d48,d4e9c03ef85c2e7952b28198eef04410,2019-10-29 10:00:41,4835236f5484f4ce65c05aaac3bd5297,a1ecccfdd09bf7b66cb7b9e06de4e680,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000,
2258956513,false,2020-12-30 4:16:23,06a77d6464bc6d5404513281a55f69d2,751bc1dafa963237e06c0f69f1cf23d6,2019-07-29 17:54:22,d471cfef4b5766cab06c98616c6e4c12,692a1af299911a0b74907c99c796ef81,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United Kingdom,10000000,
858780924,false,2020-12-30 4:16:23,8d4cacc32973fa43806d6e743a315e90,7cc08a5696f7385f44b085addd439255,2018-07-11 20:53:41,37a6259cc0c1dae299a7866489dff0bd,0e59ca4fcd625a9e8cbcaef12e52a29d,37a6259cc0c1dae299a7866489dff0bd,538f6af1d2490971ef1ccfa44b11e49c,XX,United States,10000000,432
2050238876,false,2020-12-30 4:16:22,fd845fa89c0f4541437564a0d4a83db1,a966d2c4f4a432623f710043a0a9f814,2019-05-23 12:37:25,37a6259cc0c1dae299a7866489dff0bd,3f5794cc394b2f88cdcac4b04fa1a68e,19e93bb1ceb58937019c5e8bbd02901d,32ce3f1410510651a5f862f64e137868,XX,United States,10000000,
2426544794,false,2020-12-30 3:15:52,9b1d5c6d91c9abcb04b3a6125152d177,41b60e9f786fd88c706129dd478fb713,2019-09-19 18:08:42,37a6259cc0c1dae299a7866489dff0bd,7af8dcc119f9f2dbffc67bb47fc432a8,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000,
2568965709,false,2020-12-30 4:16:21,40afc385ed39ff1a890b09aa05853446,35c9aa14cd59eea7550e94bd01b8ed45,2019-11-09 21:05:19,fdc8c08a76b5f12553dc839b8924f0df,8f76e1a2370a4b0a61c65fcad235ae69,37a6259cc0c1dae299a7866489dff0bd,0d66d119a9a135af72195d2c3ca7fce3,XX,United States,10000000,
2412860846,false,2020-12-30 4:16:20,668fdfbd0e9af92ea4eaf05fabddc3db,d41d8cd98f00b204e9800998ecf8427e,2019-09-15 2:50:54,8ca443b7a43b9681d196a55f8d090e62,2fdd9c57430a26cc45b67ba5222a9172,37a6259cc0c1dae299a7866489dff0bd,08d9eaf148bca47f7fd699c606e4558e,XX,United States,10000000,
2172830982,false,2020-12-30 4:16:22,ea1f5fc85bc26ed0284a6ac983a50fa8,25cf0f84ed5240a781f1fae5a4a15e6e,2019-07-02 22:48:57,87512a2bed0bf5045b31244650d4dce4,1c0bde7cc4b2af8e7d3c09ae152e8ebb,37a6259cc0c1dae299a7866489dff0bd,d41d8cd98f00b204e9800998ecf8427e,XX,United States,10000000,5
2436861098,false,2021-01-08 19:16:04,9b24a2dd46e664c5cbdcc015ab926921,b08d4d22fe821cf682878489fbd0b990,2019-09-24 18:47:58,b755ecacb563d4689aa5ce826cb358b2,89b5a06bb493df9f9f1c09795c0c8152,37a6259cc0c1dae299a7866489dff0bd,40097d120d9885baa23e22ee3c1fb509,XX,United States,10000000,23
1875804727,false,2021-01-01 1:15:54,76d284a57e820e5352fed186b2bb49cb,9dd3e7102bdbfa45fac1a4e0a89be7f3,2019-05-01 11:46:34,3e549b5e426932c7c8be79851c800d33,bab5e0044f4c4accb048cfcbc646ea97,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000,
1755751861,false,2021-01-01 20:15:54,ae52b283b310874855392edad9860f1b,5aec0f1d3c77e8fde09666951cc5960a,2019-03-21 18:44:36,08ded3e3b8d060ebb163f9dd4a2fe847,18bc9940888c7ab60926b62f2606e019,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United Kingdom,10000000,
2802517900,false,2020-12-30 4:16:22,05c2cd208f223ed13cf46856f3637369,ad4d0c38c4ffed1631b40c06661ce02d,2020-01-08 2:13:54,37a6259cc0c1dae299a7866489dff0bd,9ac4b85e60c1eb3b26f853bca29e25fe,37a6259cc0c1dae299a7866489dff0bd,59ead8d1e124ccfb79f3ace06f43e703,XX,United States,10000000,
2318645267,false,2020-12-30 4:16:19,80b9f7df9b05e9118515093787ab450a,897c7f6ab3be7d330a164102c1c57b84,2019-08-12 11:54:55,37a6259cc0c1dae299a7866489dff0bd,eb15251744565ff877503436b2fbded9,37a6259cc0c1dae299a7866489dff0bd,87809c954948d8a20507bee3648281b3,XX,United States,10000000,
2308842161,false,2020-12-30 4:16:23,23bda4a4a5e92e0b92281434635e001d,89bf926c2515d8dca94e673e685ed3f0,2019-08-08 12:32:54,8ca443b7a43b9681d196a55f8d090e62,920cfa229fed31fa4e7ef91c6ecfc9b4,37a6259cc0c1dae299a7866489dff0bd,f0dddde0d04dc3b9ec79302c612a3fae,XX,United States,10000000,
860870157,false,2020-06-26 2:25:42,449aad8808e10090e96d6e3f5da9067e,25884bf2573ae3371dd3194d9a7472ac,2018-07-13 12:55:25,d41d8cd98f00b204e9800998ecf8427e,7d6a756d9535452035490acc4e47db39,37a6259cc0c1dae299a7866489dff0bd,1422ded96c56c5b778bfbd78603dfafd,XX,United States,10000000,
2396583124,false,2020-12-30 4:16:22,9b017cf05a4e8e99ab17f775e085c0a8,753dae9ea2b87c5055c32981801ca928,2019-09-10 15:51:15,6796258c8758595c95121cce6706bb96,d2aee195f7fb0a54bc83a81bcaaec890,37a6259cc0c1dae299a7866489dff0bd,04ec30e97b990f9087f5fdad71ba4336,XX,United States,10000000,3245
1771990873,false,2020-12-30 4:16:23,6c1ade589848a6f5b97e27946ec5c790,c0f57d2f61377273ad37df68a1dfc9f9,2019-03-30 1:24:37,67fa9476899309473e77fe4c832035d2,cc3e9116a8c3c6c59d467f602689d7a7,37a6259cc0c1dae299a7866489dff0bd,d1ada0d3ae8ff2720b9a48a608d3d4ae,XX,United States,10000000,
2165366027,false,2020-12-30 4:16:24,beee8abdf076860d8049f6b34f87f560,7aec43fa866665673f2e49c802264290,2019-07-01 15:02:38,150b1db2e79cd4b9012c6756b5720e1a,f79d92c5b3c52f5636a3b197b34b18cb,37a6259cc0c1dae299a7866489dff0bd,09ea9b5e69df9e1385463fde29bc41cf,XX,United States,10000000,
2453842109,false,2020-12-30 4:16:20,8b7b90c56f36ccfaaf3a1c2e0ce1be5c,71e38b3556f324b7e82d4e728bf84fc3,2019-09-28 23:27:44,37a6259cc0c1dae299a7866489dff0bd,fae086294a1b1da828c0dec9b185259d,37a6259cc0c1dae299a7866489dff0bd,25efc916cf9837e321f5157f8e9fed4c,XX,United States,10000000,
2814875518,false,2020-12-30 4:16:23,5b6c46120aeaee12a013d088acde8ecf,e1f23fc586d2dce96d72b8d24b5c61f2,2020-01-10 17:13:01,37a6259cc0c1dae299a7866489dff0bd,95829bb5cb0436f1513dfb18678eadfd,37a6259cc0c1dae299a7866489dff0bd,9cfa1e69f507d007a516eb3e9f5074e2,XX,United States,10000000,
2759780517,false,2020-12-30 4:16:20,685012b2729f6a580c6620f0a5192e8d,e1e4464aae529785549615b5e53f8c3a,2019-12-27 20:19:25,d41d8cd98f00b204e9800998ecf8427e,88957c6c21a2bc52a54880f22002c3db,37a6259cc0c1dae299a7866489dff0bd,c17ba32b360562102687b5ac3f122692,XX,United States,10000000,323
2402736100,false,2020-12-30 4:16:23,29ffbc5b6f1e85c758b08acc61e586b0,d86afee1071e0be83e787857d1c67a47,2019-09-11 16:59:48,d41d8cd98f00b204e9800998ecf8427e,dcdcdfa2e85d945e97fa72b2da9affbc,37a6259cc0c1dae299a7866489dff0bd,25efc916cf9837e321f5157f8e9fed4c,XX,United States,10000000,43
2 changes: 1 addition & 1 deletion macros/get_company_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{"name": "property_annualrevenue", "datatype": dbt.type_int(), "alias": "company_annual_revenue"}
] %}

{{ fivetran_utils.add_pass_through_columns(columns, var('hubspot__company_pass_through_columns')) }}
{{ hubspot_add_pass_through_columns(columns, var('hubspot__company_pass_through_columns')) }}

{{ return(columns) }}

Expand Down
14 changes: 14 additions & 0 deletions macros/hubspot_add_pass_through_columns.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% macro hubspot_add_pass_through_columns(base_columns, pass_through_var) %}

{% if pass_through_var %}
{% for column in pass_through_var %}
{% set quoted_column_name = adapter.quote(column.name) %}
{% if column.alias %}
{% do base_columns.append({ "name": quoted_column_name, "alias": adapter.quote(column.alias) }) %}
{% else %}
{% do base_columns.append({ "name": quoted_column_name }) %}
{% endif %}
{% endfor %}
{% endif %}

{% endmacro %}
fivetran-reneeli marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions models/stg_hubspot__company.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ with base as (
}}
{% if all_passthrough_column_check('stg_hubspot__company_tmp',get_company_columns()) > 0 %}
-- just pass everything through if extra columns are present, but ensure required columns are present.
,{{
fivetran_utils.remove_prefix_from_columns(
{{
hubspot_source.remove_duplicate_and_prefix_from_columns(
columns=adapter.get_columns_in_relation(ref('stg_hubspot__company_tmp')),
prefix='property_', exclude=get_macro_columns(get_company_columns()))
}}
Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__contact.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ with base as (
}}
{% if all_passthrough_column_check('stg_hubspot__contact_tmp',get_contact_columns()) > 0 %}
-- just pass everything through if extra columns are present, but ensure required columns are present.
,{{
fivetran_utils.remove_prefix_from_columns(
{{
hubspot_source.remove_duplicate_and_prefix_from_columns(
columns=adapter.get_columns_in_relation(ref('stg_hubspot__contact_tmp')),
prefix='property_', exclude=get_macro_columns(get_contact_columns()))
}}
Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__deal.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ with base as (
}}
{% if all_passthrough_column_check('stg_hubspot__deal_tmp',get_deal_columns()) > 0 %}
-- just pass everything through if extra columns are present, but ensure required columns are present.
,{{
fivetran_utils.remove_prefix_from_columns(
{{
hubspot_source.remove_duplicate_and_prefix_from_columns(
columns=adapter.get_columns_in_relation(ref('stg_hubspot__deal_tmp')),
prefix='property_',exclude=get_macro_columns(get_deal_columns()))
}}
Expand Down