Skip to content

Commit

Permalink
Add details_json field to eho tables (#67)
Browse files Browse the repository at this point in the history
* Add details_json field to eho tables
  • Loading branch information
chowbao authored Jul 30, 2024
1 parent 89a33af commit 06283c9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/marts/enriched_history/enriched_history_operations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ with
, contract_code_hash
, operation_result_code
, operation_trace_code
, details_json
from {{ ref('stg_history_operations') }}
where
cast(batch_run_date as date) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 2 day)
Expand Down Expand Up @@ -384,6 +385,8 @@ with
, hist_ledg.protocol_version
, hist_ledg.successful_transaction_count
, hist_ledg.failed_transaction_count
-- json blob for operation details
, hist_ops.details_json
-- general fields
, hist_ops.batch_id
, hist_ops.batch_run_date
Expand Down
3 changes: 3 additions & 0 deletions models/marts/enriched_history/enriched_history_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,6 @@ models:

- name: operation_trace_code
description: '{{ doc("operation_trace_code") }}'

- name: details_json
description: '{{ doc("details") }}'
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ with
, enriched.protocol_version
, enriched.successful_transaction_count
, enriched.failed_transaction_count
-- json blob for operation details
, enriched.details_json
-- general fields
, enriched.batch_id
, enriched.batch_run_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,6 @@ models:

- name: operation_trace_code
description: '{{ doc("operation_trace_code") }}'

- name: details_json
description: '{{ doc("details") }}'
3 changes: 3 additions & 0 deletions models/sources/src_history_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,6 @@ sources:
- not_null:
config:
where: batch_run_date > current_datetime - interval 2 day

- name: details_json
description: '{{ doc("details") }}'
1 change: 1 addition & 0 deletions models/staging/stg_history_operations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ with
, details.extend_to
, details.contract_id
, details.contract_code_hash
, details_json
, operation_result_code
, operation_trace_code
, closed_at
Expand Down

0 comments on commit 06283c9

Please sign in to comment.