Skip to content

Commit 237654d

Browse files
Merge pull request #60 from fivetran/bugfix/redshift_empty_tables
add limit 1 for redshift
2 parents 89c0de9 + d54c90b commit 237654d

8 files changed

+27
-16
lines changed

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# dbt_zendesk_source v0.15.0
2+
3+
## Under the Hood
4+
- (Affects Redshift only) Updates the `union_zendesk_connections` macro to use a limit 1 instead of limit 0 for empty tables.
5+
- When a table is empty, Redshift ignores explicit data casts and will materialize every column as a `varchar`. Redshift users may experience errors in downstream transformations as a consequence.
6+
- For each staging model, if the source table is not found, the package will create a empty table with 0 rows for non-Redshift warehouses and a table with 1 all-`null` row for Redshift destinations. The 1 row will ensure that Redshift will respect the package's datatype casts.
7+
8+
## Documentation Update
9+
- Moved badges at top of the README below the H1 header to be consistent with popular README formats.
10+
111
# dbt_zendesk_source v0.14.2
212
[PR #59](https://github.com/fivetran/dbt_zendesk_source/pull/59) includes the following updates:
313

@@ -12,7 +22,7 @@
1222

1323
## Documentation Updates
1424
- Added enabled config variables to `brand`, `organization` and `organization_tag` in the `src_zendesk.yml` models.
15-
- [Updated README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#step-4-enabledisable-models-for-non-existent-sources) with instructions on how to disable `brand` and `organization` sources.
25+
- [Updated README](https://github.com/fivetran/dbt_zendesk_source?tab=readme-ov-file#step-4-enabledisable-models-for-non-existent-sources) with instructions on how to disable `brand` and `organization` sources.
1626

1727
# dbt_zendesk_source v0.14.1
1828

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<p align="center">
1+
# Zendesk Support Source dbt Package ([Docs](https://fivetran.github.io/dbt_zendesk_source/))
2+
3+
<p align="left">
24
<a alt="License"
35
href="https://github.com/fivetran/dbt_zendesk_source/blob/main/LICENSE">
46
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
@@ -13,7 +15,6 @@
1315
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
1416
</p>
1517

16-
# Zendesk Support Source dbt Package ([Docs](https://fivetran.github.io/dbt_zendesk_source/))
1718
## What does this dbt package do?
1819
<!--section="zendesk_source_model"-->
1920
- Materializes [Zendesk Support staging tables](https://fivetran.github.io/dbt_github_source/#!/overview/zendesk_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/zendesk#schemainformation). These staging tables clean, test, and prepare your Zendesk Support data from [Fivetran's connector](https://fivetran.com/docs/applications/zendesk) for analysis by doing the following:
@@ -44,7 +45,7 @@ Include the following zendesk_source package version in your `packages.yml` file
4445
```yaml
4546
packages:
4647
- package: fivetran/zendesk_source
47-
version: [">=0.14.0", "<0.15.0"]
48+
version: [">=0.15.0", "<0.16.0"]
4849
```
4950
### Step 3: Define database and schema variables
5051
#### Option A: Single connector

dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config-version: 2
22
name: 'zendesk_source'
3-
version: '0.14.2'
3+
version: '0.15.0'
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55

66
models:

docs/catalog.json

+1-1
Large diffs are not rendered by default.

docs/manifest.json

+1-1
Large diffs are not rendered by default.

integration_tests/ci/sample.profiles.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ integration_tests:
1616
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
1717
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
1818
port: 5439
19-
schema: zendesk_source_integrations_tests_5
19+
schema: zendesk_source_integrations_tests_7
2020
threads: 8
2121
bigquery:
2222
type: bigquery
2323
method: service-account-json
2424
project: 'dbt-package-testing'
25-
schema: zendesk_source_integrations_tests_5
25+
schema: zendesk_source_integrations_tests_7
2626
threads: 8
2727
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
2828
snowflake:
@@ -33,7 +33,7 @@ integration_tests:
3333
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
3434
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
3535
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
36-
schema: zendesk_source_integrations_tests_5
36+
schema: zendesk_source_integrations_tests_7
3737
threads: 8
3838
postgres:
3939
type: postgres
@@ -42,13 +42,13 @@ integration_tests:
4242
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
4343
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
4444
port: 5432
45-
schema: zendesk_source_integrations_tests_5
45+
schema: zendesk_source_integrations_tests_7
4646
threads: 8
4747
databricks:
4848
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
4949
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
5050
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
51-
schema: zendesk_source_integrations_tests_5
51+
schema: zendesk_source_integrations_tests_7
5252
threads: 2
5353
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
5454
type: databricks

integration_tests/dbt_project.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
config-version: 2
22

33
name: 'zendesk_source_integration_tests'
4-
version: '0.14.2'
4+
version: '0.15.0'
55

66
profile: 'integration_tests'
77

88
vars:
99

10-
zendesk_schema: zendesk_source_integrations_tests_5
10+
zendesk_schema: zendesk_source_integrations_tests_7
1111
zendesk_source:
1212
zendesk_organization_identifier: "organization_data"
1313
zendesk_schedule_identifier: "schedule_data"

macros/union/union_zendesk_connections.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{% endif -%}
3838
select
3939
cast(null as {{ dbt.type_string() }}) as _dbt_source_relation
40-
limit 0
40+
limit {{ '0' if target.type != 'redshift' else '1' }}
4141
{%- endif -%}
4242

4343
{% else %}
@@ -63,7 +63,7 @@
6363

6464
select
6565
cast(null as {{ dbt.type_string() }}) as _dbt_source_relation
66-
limit 0
66+
limit {{ '0' if target.type != 'redshift' else '1' }}
6767
{%- endif -%}
6868
{% endif -%}
6969

0 commit comments

Comments
 (0)