Skip to content

Commit b603a3b

Browse files
Filter out problematic ticket_chat_event records (#72)
* stage * polish
1 parent 43d7d8f commit b603a3b

File tree

8 files changed

+16
-7
lines changed

8 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# dbt_zendesk_source v0.18.1
2+
3+
[PR #72](https://github.com/fivetran/dbt_zendesk_source/pull/72) includes the following updates:
4+
5+
## Bug Fix
6+
- Excludes `ticket_chat_event` records where the `actor_id` is `__trigger` or `__system` (instead of the expected `######` or `agent:######` formats). This was done to avoid data-casting errors in `stg_zendesk__ticket_chat_event` and maintain downstream joins and comment metrics.
7+
18
# dbt_zendesk_source v0.18.0
29

310
[PR #71](https://github.com/fivetran/dbt_zendesk_source/pull/71) includes the following updates:

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config-version: 2
22
name: 'zendesk_source'
3-
version: '0.18.0'
3+
version: '0.18.1'
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55

66
models:

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config-version: 2
22

33
name: 'zendesk_source_integration_tests'
4-
version: '0.18.0'
4+
version: '0.18.1'
55

66
profile: 'integration_tests'
77

integration_tests/seeds/ticket_chat_event_data.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ chat_id,created_at,_Company_synced,actor_id,chat_index,external_message_id,filen
77
4323.953441.T6OrgbvMIqPplK,2023-12-08 05:07:28.408000,2024-03-19 16:51:30.989000,403959218893,0,,,,No problem. Just share a few details and I'll connect you with someone from our team.,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[],""text"":""Thanks. Let me connect you with a customer support agent.""}},""id"":""658d843188000ddefeeba3f2"",""metadata"":{""fields"":{}},""received"":""2023-12-28T14:20:33.333Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
88
4323.953441.TzkBGrapJoA,2023-12-28 14:22:12.840000,2024-03-19 16:51:21.702000,403969141094,0,,,,No problem. Just share a few details and I'll connect you with someone from our team.,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""form"":{""block_chat_input"":false,""fields"":[{""label"":""Name"",""name"":""dataCapture.systemField.requester.name"",""text"":{""max_size"":256,""min_size"":1,""text"":""Name""}},{""email"":{""email"":""email""},""label"":""Email"",""name"":""dataCapture.systemField.requester.email""}]}},""id"":""658d841e69c2dcac0bc5a"",""metadata"":{""fields"":{""formId"":{""string_value"":""DataCaptureForm""},""nextNodeId"":{""string_value"":""01HEYB2GDS9HSRDAV_01HJRCQ1Y5EDYFHKZ6""},""nodeId"":{""string_value"":""01HJRCQ1Y4MJEYB2GDS9HSRDAV_01HJRCQ1NZJ77B4""}}},""received"":""2023-12-28T14:20:14.563Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
99
4323.953441.TzkArUd3CjKI,2023-12-28 14:20:35.032000,2024-03-19 16:51:23.267000,403959218893,0,,,,Hi there. Got a question? I'm here to help.,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[],""text"":""No problem. Just share a few details and I'll connect you with someone from our team.""}},""id"":""658d8481d00e97935de863ab"",""metadata"":{""fields"":{}},""received"":""2023-12-28T14:21:53.345Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
10-
4323.953441.TzAcedetjkcKyq,2023-12-22 10:37:20.489000,2024-03-19 16:51:25.454000,403969141094,0,,,,,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[],""text"":""No problem. Just share a few details and I'll connect you with someone from our team.""}},""id"":""65bce6a92a2fe21c"",""metadata"":{""fields"":{}},""received"":""2024-02-02T12:57:13.130Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
11-
4323.953441.TyDt23helloZt4E,2023-12-12 11:20:10.181000,2024-03-19 16:51:27.764000,403959218893,0,,,,TALK TO A HUMAN,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[{""reply"":{""payload"":""goto_node=01HJRCSAC466_01HJRCSAC4FV78SSW""},""text"":""Talk to a human""}],""text"":""Hi there. Got a question? I'm here to help.""}},""id"":""65bce6a06765305e2a2fd629"",""metadata"":{""fields"":{}},""received"":""2024-02-02T12:57:04.171Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
10+
4323.953441.TzAcedetjkcKyq,2023-12-22 10:37:20.489000,2024-03-19 16:51:25.454000,__system,0,,,,,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[],""text"":""No problem. Just share a few details and I'll connect you with someone from our team.""}},""id"":""65bce6a92a2fe21c"",""metadata"":{""fields"":{}},""received"":""2024-02-02T12:57:13.130Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,
11+
4323.953441.TyDt23helloZt4E,2023-12-12 11:20:10.181000,2024-03-19 16:51:27.764000,__trigger,0,,,,TALK TO A HUMAN,,,,"{""author"":{""avatar_url"":""url"",""display_name"":""Company Bot"",""type"":""BUSINESS""},""content"":{""text"":{""actions"":[{""reply"":{""payload"":""goto_node=01HJRCSAC466_01HJRCSAC4FV78SSW""},""text"":""Talk to a human""}],""text"":""Hi there. Got a question? I'm here to help.""}},""id"":""65bce6a06765305e2a2fd629"",""metadata"":{""fields"":{}},""received"":""2024-02-02T12:57:04.171Z"",""source"":{""type"":""zd:answerBot""}}",,,,,,,ChatMessage,

models/stg_zendesk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ models:
503503
Empty string if you are not.
504504
505505
- name: stg_zendesk__ticket_chat_event
506-
description: Information about chat and messaging events on tickets.
506+
description: Information about chat and messaging events on tickets. Excludes records in which the `actor_id` is either `__trigger` or `__system`.
507507
tests:
508508
- dbt_utils.unique_combination_of_columns:
509509
combination_of_columns:

models/stg_zendesk__ticket_chat_event.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ final as (
4848
url
4949

5050
from fields
51+
{# Exclude these types of chat events from downstream metrics #}
52+
where actor_id not in ('__trigger', '__system')
5153
)
5254

5355
select *

0 commit comments

Comments
 (0)