Skip to content

Commit

Permalink
doc twweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-jamie committed Apr 15, 2024
1 parent ba813f4 commit 6bb1cdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

## Feature Updates
- Adds passthrough column support for `USER` and `ORGANIZATION`.
- Using the new `zendesk__user_passthrough_columns` and `zendesk__organizations_passthrough_columns` variables, you can include custom columns from these source tables in their respective staging models. See [README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#add-passthrough-columns) for more details on how to configure.
- Also updated the format of the pre-existing `TICKET` passthrough column variable, `zendesk__ticket_passthrough_columns`.
- Previously, you could only provide a list of custom fields to be included in `stg_zendesk__ticket`. Now, you can provide an `alias` and `transform_sql` clause to be applied to each field (see [README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#add-passthrough-columns) for more details).
- Using the new `zendesk__user_passthrough_columns` and `zendesk__organization_passthrough_columns` variables, you can include custom columns from these source tables in their respective staging models. See [README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#add-passthrough-columns) for more details on how to configure.
- Also updated the format of the pre-existing `TICKET` passthrough column variable, `zendesk__ticket_passthrough_columns`, to align with the newly added passthrough variables delineated above.
- Previously, you could only provide a list of custom fields to be included in `stg_zendesk__ticket`. Now, you have the option to provide an `alias` and `transform_sql` clause to be applied to each field (see [README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#add-passthrough-columns) for more details).
- **Note**: the package is and will continue to be backwards compatible with the old list-format.

# dbt_zendesk_source v0.11.1
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ vars:
<details open><summary>Collapse/Expand configurations</summary>

### Add passthrough columns
This package includes all source columns defined in the macros folder. You can add more columns from the `TICKET`, `USER`, and `ORGANIZATION` tables using our pass-through column variables, which will persist these custom fields to the `stg_zendesk__ticket`, `stg_zendesk__user`, and `stg_zendesk__organization` models, repsectively. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:
This package includes all source columns defined in the macros folder. You can add more columns from the `TICKET`, `USER`, and `ORGANIZATION` tables using our pass-through column variables, which will persist these custom fields to the `stg_zendesk__ticket`, `stg_zendesk__user`, and `stg_zendesk__organization` models, respectively.

These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-through fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:

```yml
vars:
zendesk__ticket_passthrough_columns:
- name: "account_custom_field_1" # required
alias: "account_1" # optional
transform_sql: "cast(account_1 as string)" # optional, must reference the alias (if provided)
transform_sql: "cast(account_1 as string)" # optional, must reference the alias if an alias is provided (otherwise the original name)
- name: "account_custom_field_2"
transform_sql: "cast(account_custom_field_2 as string)"
- name: "account_custom_field_3"
Expand Down

0 comments on commit 6bb1cdc

Please sign in to comment.