-
Notifications
You must be signed in to change notification settings - Fork 121
Ele 4724 dbt fusion support #825
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
Changes from all commits
713b6d9
342e15c
903216f
a9add36
a52af65
a9178fe
dd4d4e8
d6fa00a
fc89168
772757d
f12d352
b65173d
15b967e
5521709
c8e6ad0
98ced8b
348e68a
b332b0e
d4de2a3
1fc95b5
ca9c375
e59205b
3ce6815
2fe0ecb
de96055
50c8797
8824494
2ea9576
3938917
341ade5
4f826c5
20cde94
a82e1d5
14c1304
a9156b1
3719bb1
0c80c45
691603c
2fce8c6
c5697f0
58c882c
0c5d47c
4a3c65a
10f7a90
2adb267
1279385
9cb8baa
f7a48aa
2d4335f
8f5e5a7
9ceb8bb
0715d3e
0b96941
abf55d5
2f56eec
194824e
0612acd
8593c35
f3097dd
e48a7c4
d6306dd
871083e
2d34feb
8a6322d
066d8d6
c07e50d
5f5acae
90719dd
bfeb196
ff201c0
93dfa43
19b708f
1177b5e
72d9576
4a46a7b
7f9f8d7
f47e239
7d3f055
34330ec
e36c5d7
7667f8e
29e82db
54530f7
9fe3c53
271e601
dc2a9ff
3f1a9aa
51b3da1
8bbf168
e2dc737
e588009
87db804
cb76509
df232d4
51f330e
e5d2f8d
957a0fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,6 @@ __pycache__/ | |
|
|
||
| # vscode | ||
| .vscode/ | ||
| dbt_internal_packages/ | ||
|
|
||
| /package-lock.yml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| data | ||
| models/tmp | ||
| dbt_internal_packages/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,6 @@ clean-targets: # directories to be removed by `dbt clean` | |
|
|
||
| vars: | ||
| debug_logs: "{{ env_var('DBT_EDR_DEBUG', False) }}" | ||
| mute_ensure_materialization_override: true | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our whole instruction to add a flag for overriding materializations is not relevant anymore in Fusion. We need customers to override the materialization themselves. |
||
|
|
||
| models: | ||
| elementary_tests: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| {% materialization test, default %} | ||
| {% if var('enable_elementary_test_materialization', false) %} | ||
| {% do return(elementary.materialization_test_default.call_macro()) %} | ||
| {% do return(elementary.materialization_test_default()) %} | ||
| {% else %} | ||
| {% do return(dbt.materialization_test_default.call_macro()) %} | ||
| {% do return(dbt.materialization_test_default()) %} | ||
| {% endif %} | ||
| {% endmaterialization %} | ||
|
|
||
| {% materialization test, adapter="snowflake" %} | ||
| {% if var('enable_elementary_test_materialization', false) %} | ||
| {% do return(elementary.materialization_test_snowflake.call_macro()) %} | ||
| {% do return(elementary.materialization_test_snowflake()) %} | ||
| {% else %} | ||
| {% if dbt.materialization_test_snowflake %} | ||
| {% do return(dbt.materialization_test_snowflake.call_macro()) %} | ||
| {% do return(dbt.materialization_test_snowflake()) %} | ||
| {% else %} | ||
| {% do return(dbt.materialization_test_default.call_macro()) %} | ||
| {% do return(dbt.materialization_test_default()) %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endmaterialization %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {% macro replace_empty_strings_with_nulls(table_name) %} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a test macro that bypasses an issue with BQ seeds in fusion - where nulls are loaded as empty strings (it messed up the tests as some of them use not_null tests - so I just created this macro to change empty strings to nulls) |
||
| {% set relation = ref(table_name) %} | ||
| {% set columns = adapter.get_columns_in_relation(relation) %} | ||
|
|
||
| {% for col in columns %} | ||
| {% set data_type = elementary.get_column_data_type(col) %} | ||
| {% set normalized_data_type = elementary.normalize_data_type(data_type) %} | ||
|
|
||
| {% if normalized_data_type == "string" %} | ||
| {% set update_query %} | ||
| update {{ relation }} | ||
| set {{ col["name"] }} = NULL | ||
| where {{ col["name"] }} = '' | ||
ofek1weiss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {% endset %} | ||
| {% do elementary.run_query(update_query) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% endmacro %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,11 +15,12 @@ exposures: | |
| owner: | ||
| name: Callum McData | ||
| email: [email protected] | ||
| meta: | ||
| referenced_columns: | ||
| - column_name: id | ||
| data_type: numeric | ||
| node: ref('customers') | ||
| config: | ||
| meta: | ||
| referenced_columns: | ||
| - column_name: id | ||
| data_type: numeric | ||
| node: ref('customers') | ||
|
|
||
haritamar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: orders | ||
| label: Returned Orders | ||
|
|
@@ -35,8 +36,9 @@ exposures: | |
| owner: | ||
| name: Callum McData | ||
| email: [email protected] | ||
| meta: | ||
| referenced_columns: | ||
| - column_name: "order_id" | ||
| data_type: "string" | ||
| - column_name: "ZOMG" | ||
| config: | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. YAML schema changes in fusion, meta/tags need to be under |
||
| meta: | ||
| referenced_columns: | ||
| - column_name: "order_id" | ||
| data_type: "string" | ||
| - column_name: "ZOMG" | ||
haritamar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,4 @@ | ||
| packages: | ||
| - local: ../../ | ||
| - package: dbt-labs/dbt_utils | ||
| version: | | ||
| {%- set minor_to_utils_range_map = { | ||
| "0": [">=0.8.0", "<0.9.0"], | ||
| "1": [">=0.8.0", "<0.9.0"], | ||
| "2": [">=0.8.0", "<1.0.0"], | ||
| } -%} | ||
| {{- minor_to_utils_range_map.get(dbt_version.split('.')[1], [">=0.8.0", "<2.0.0"]) -}} | ||
| version: [">=0.8.0", "<2.0.0"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| {% materialization test, default %} | ||
| {% do return(elementary.materialization_test_default.call_macro()) %} | ||
| {% do return(elementary.materialization_test_default()) %} | ||
| {% endmaterialization %} | ||
|
|
||
| {% materialization test, adapter="snowflake" %} | ||
| {% do return(elementary.materialization_test_snowflake.call_macro()) %} | ||
| {% do return(elementary.materialization_test_snowflake()) %} | ||
| {% endmaterialization %} |
Uh oh!
There was an error while loading. Please reload this page.
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.
Fix dbt‑fusion binary path
install.shdrops the fusion CLI at~/.dbt/bin/dbt, not~/.local/bin/dbt. With the current hard‑coded path, bothdepsanddebugwill fail at runtime (command not found). Please point the conditional to the actual install location (or dynamically resolve the path) before we merge.📝 Committable suggestion
🤖 Prompt for AI Agents
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 it is wrong in this case, it's definitely installed in "~/.local/bin/dbt" and the CI currently works for fusion
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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 19381
@haritamar, you're absolutely right—I apologize for the confusion. After reviewing the install script, I can confirm that the default installation path is indeed
~/.local/bin/dbt, not~/.dbt/bin/dbt. The script sets:dest="$HOME/.local/bin"Since your workflow only passes
--updateto the installer, it uses this default location. Your current implementation is correct, and I was mistaken. Thank you for clarifying that the CI is working as expected! I'll resolve this comment thread.🐰💭
(Got that one wrong—
learning from humans!)