Skip to content

Commit

Permalink
Merge pull request #516 from elementary-data/adapter-response
Browse files Browse the repository at this point in the history
Adapter response tests
  • Loading branch information
elongl authored Aug 30, 2023
2 parents 48f4fb3 + 4aa9c4a commit 974195d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions macros/edr/dbt_artifacts/upload_run_results.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
('failures', 'bigint'),
('query_id', 'string'),
('thread_id', 'string'),
('materialization', 'string')
('materialization', 'string'),
('adapter_response', 'string')
]) %}
{{ return(dbt_run_results_empty_table_query) }}
{% endmacro %}
Expand Down Expand Up @@ -59,7 +60,8 @@
'failures': run_result_dict.get('failures'),
'query_id': run_result_dict.get('adapter_response', {}).get('query_id'),
'thread_id': run_result_dict.get('thread_id'),
'materialization': config_dict.get('materialized')
'materialization': config_dict.get('materialized'),
'adapter_response': run_result_dict.get('adapter_response', {})
}%}

{% set timings = elementary.safe_get_with_default(run_result_dict, 'timing', []) %}
Expand Down
1 change: 1 addition & 0 deletions models/edr/run_results/model_run_results.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SELECT
run_results.compile_started_at,
run_results.compile_completed_at,
run_results.compiled_code,
run_results.adapter_response,
run_results.thread_id,
models.database_name,
models.schema_name,
Expand Down
1 change: 1 addition & 0 deletions models/edr/run_results/snapshot_run_results.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SELECT
run_results.compile_started_at,
run_results.compile_completed_at,
run_results.compiled_code,
run_results.adapter_response,
run_results.thread_id,
snapshots.database_name,
snapshots.schema_name,
Expand Down
4 changes: 4 additions & 0 deletions models/run_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ models:
data_type: string
description: Id of the thread of this resource run.

- name: adapter_response
data_type: string
description: Response returned by the adapter (Fields will be different for each adapters).

- name: elementary_test_results
description: >
Run results of all dbt tests, with fields and metadata needed to produce the Elementary report UI.
Expand Down

0 comments on commit 974195d

Please sign in to comment.