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

Roadmap - Shutdown Docs AE Glossary #6111

Merged
merged 25 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6109056
refactor Term component to pull from single file
JKarlavige Sep 20, 2024
5cf4e1d
migrate terms to single terms.md file
JKarlavige Sep 20, 2024
60d5799
exclude docs in terms directory from building pages
JKarlavige Sep 20, 2024
9259ae8
remove glossary sidebar section
JKarlavige Sep 20, 2024
3cc57a2
remove glossary nav link
JKarlavige Sep 20, 2024
992a933
remove term pages and directory and relocate terms.md file
JKarlavige Sep 20, 2024
0b8fce0
update demo test-terms page
JKarlavige Sep 20, 2024
46c23a5
remove link component from term component
JKarlavige Sep 20, 2024
7034b34
adjust pageReady handling in terms component
JKarlavige Sep 20, 2024
06f2c75
update name of hover-terms file
JKarlavige Sep 20, 2024
238844f
update comment
JKarlavige Sep 20, 2024
575c176
update term links on two pages
JKarlavige Sep 20, 2024
115d50f
move hover-terms into terms directory to suppress partial warning
JKarlavige Sep 23, 2024
a4aa9b6
fix text color when term used in callout
JKarlavige Sep 23, 2024
769ca87
revert pageReady edits to Term component
JKarlavige Sep 23, 2024
93288c9
only use ReactTooltip if hoverSnippet set
JKarlavige Sep 23, 2024
d8e8999
add redirects
JKarlavige Sep 23, 2024
41a1197
Merge branch 'current' into roadmap/ae-glossary
JKarlavige Sep 23, 2024
72ad8e2
Merge branch 'current' into roadmap/ae-glossary
mirnawong1 Sep 24, 2024
b5e9a92
update data-grain redirect
JKarlavige Sep 24, 2024
12dfa05
merge current
JKarlavige Sep 24, 2024
fd0b898
Merge branch 'current' into roadmap/ae-glossary
JKarlavige Sep 26, 2024
4ec0649
bring back 3 etl pages so these remain live while working on new blog…
JKarlavige Sep 26, 2024
33bdcc3
remove test terms and test page
JKarlavige Sep 26, 2024
3ea1881
Merge branch 'current' into roadmap/ae-glossary
JKarlavige Oct 2, 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
6 changes: 3 additions & 3 deletions website/docs/docs/build/incremental-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Not specifying a `unique_key` will result in append-only behavior, which means d

The optional `unique_key` parameter specifies a field (or combination of fields) that defines the grain of your model. That is, the field(s) identify a single unique row. You can define `unique_key` in a configuration block at the top of your model, and it can be a single column name or a list of column names.

The `unique_key` should be supplied in your model definition as a string representing a single column or a list of single-quoted column names that can be used together, for example, `['col1', 'col2', …])`. Columns used in this way should not contain any nulls, or the incremental model run may fail. Either ensure that each column has no nulls (for example with `coalesce(COLUMN_NAME, 'VALUE_IF_NULL')`), or define a single-column [surrogate key](/terms/surrogate-key) (for example with [`dbt_utils.generate_surrogate_key`](https://github.com/dbt-labs/dbt-utils#generate_surrogate_key-source)).
The `unique_key` should be supplied in your model definition as a string representing a single column or a list of single-quoted column names that can be used together, for example, `['col1', 'col2', …])`. Columns used in this way should not contain any nulls, or the incremental model run may fail. Either ensure that each column has no nulls (for example with `coalesce(COLUMN_NAME, 'VALUE_IF_NULL')`), or define a single-column [surrogate key](https://www.getdbt.com/blog/guide-to-surrogate-key) (for example with [`dbt_utils.generate_surrogate_key`](https://github.com/dbt-labs/dbt-utils#generate_surrogate_key-source)).

:::tip
In cases where you need multiple columns in combination to uniquely identify each row, we recommend you pass these columns as a list (`unique_key = ['user_id', 'session_number']`), rather than a string expression (`unique_key = 'concat(user_id, session_number)'`).
Expand All @@ -103,15 +103,15 @@ By using the first syntax, which is more universal, dbt can ensure that the colu

When you pass a list in this way, please ensure that each column does not contain any nulls, or the incremental model run may fail.

Alternatively, you can define a single-column [surrogate key](/terms/surrogate-key), for example with [`dbt_utils.generate_surrogate_key`](https://github.com/dbt-labs/dbt-utils#generate_surrogate_key-source).
Alternatively, you can define a single-column [surrogate key](https://www.getdbt.com/blog/guide-to-surrogate-key), for example with [`dbt_utils.generate_surrogate_key`](https://github.com/dbt-labs/dbt-utils#generate_surrogate_key-source).
:::

When you define a `unique_key`, you'll see this behavior for each row of "new" data returned by your dbt model:

* If the same `unique_key` is present in the "new" and "old" model data, dbt will update/replace the old row with the new row of data. The exact mechanics of how that update/replace takes place will vary depending on your database, [incremental strategy](/docs/build/incremental-strategy), and [strategy specific configs](/docs/build/incremental-strategy#strategy-specific-configs).
* If the `unique_key` is _not_ present in the "old" data, dbt will insert the entire row into the table.

Please note that if there's a unique_key with more than one row in either the existing target table or the new incremental rows, the incremental model may fail depending on your database and [incremental strategy](/docs/build/incremental-strategy). If you're having issues running an incremental model, it's a good idea to double check that the unique key is truly unique in both your existing database table and your new incremental rows. You can [learn more about surrogate keys here](/terms/surrogate-key).
Please note that if there's a unique_key with more than one row in either the existing target table or the new incremental rows, the incremental model may fail depending on your database and [incremental strategy](/docs/build/incremental-strategy). If you're having issues running an incremental model, it's a good idea to double check that the unique key is truly unique in both your existing database table and your new incremental rows. You can [learn more about surrogate keys here](https://www.getdbt.com/blog/guide-to-surrogate-key).

:::info
While common incremental strategies, such as`delete+insert` + `merge`, might use `unique_key`, others don't. For example, the `insert_overwrite` strategy does not use `unique_key`, because it operates on partitions of data rather than individual rows. For more information, see [About incremental_strategy](/docs/build/incremental-strategy).
Expand Down
20 changes: 20 additions & 0 deletions website/docs/docs/test-terms.md
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

delete before merge

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Testing Terms component"
id: "test-terms"
pagination_next: null
pagination_prev: null
---

This should show a term: <Term id="deploying">Deploying</Term>

This should show a term: <Term id="data-wrangling">Data wrangling</Term>

This should show a term: <Term id="model">Model</Term>

This should show demoTerm: <Term id="demoTerm" />

This should show noDisplayText term id as children and displayText not set: <Term id="noDisplayText" />

This has displayText set but no hoverSnippet set: <Term id="noHoverSnippet" />

This should NOT show a hover snippet (but should still show children): <Term id="demo">Demo</Term>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @JKarlavige This looks correct, but not sure what you mean by it should still show children?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question! If the Term component is used but the id isn't found in hover-terms.md, it would still show the children of the component, in this case the text Demo. These are just some test cases i added for us to test when reviewing the PR. But i will remove all of these before merge.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ slug: /sql-reference/sum

The SQL SUM function is handy and ever-present in data work. Let’s unpack what it is, how to use it, and why it's valuable.

Jumping into it, the SUM aggregate function allows you to calculate the sum of a numeric column or across a set of rows for a column. Ultimately, the SUM function is incredibly useful for calculating meaningful business metrics, such as Lifetime Value (LTV), and creating key numeric fields in [`fct_` and `dim_` models](/terms/dimensional-modeling).
Jumping into it, the SUM aggregate function allows you to calculate the sum of a numeric column or across a set of rows for a column. Ultimately, the SUM function is incredibly useful for calculating meaningful business metrics, such as Lifetime Value (LTV), and creating key numeric fields in [`fct_` and `dim_` models](https://www.getdbt.com/blog/guide-to-dimensional-modeling).

## How to use the SUM function in a query

Expand Down
192 changes: 0 additions & 192 deletions website/docs/terms/cte.md

This file was deleted.

Loading
Loading