-
Notifications
You must be signed in to change notification settings - Fork 220
Ele 826 orchestration integration #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7084aac
add get_invocations_by_ids (macro, fetcher, and api)
NoyaArie bfe4a7a
add get_resources_latest_invocation (macro, fetcher, and api)
NoyaArie 18fe560
add invocation schema fields
NoyaArie e641046
add data to report
NoyaArie 1edd259
run black
NoyaArie 8a46546
isort
NoyaArie 933b9c3
format import
NoyaArie 9eb3bac
format + style
NoyaArie 1801232
refactor
NoyaArie 34cd3b5
remove relation_exists for dbt run results
NoyaArie d561bcf
rename
NoyaArie e5dd99f
refactor + remove edr_log
NoyaArie d74d548
List
NoyaArie 9a4917e
column_exists
NoyaArie bc4044f
update json file for tests
NoyaArie 5f127cb
replace index.html
NoyaArie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
elementary/monitor/dbt_project/macros/get_invocations_by_ids.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| {% macro get_invocations_by_ids(ids) %} | ||
| {% set database, schema = elementary.target_database(), target.schema %} | ||
| {% set invocations_relation = adapter.get_relation(database, schema, 'dbt_invocations') %} | ||
| {% set column_exists = elementary.column_exists_in_relation(invocations_relation, 'job_url') %} | ||
|
|
||
| {% if invocations_relation %} | ||
| {% set get_invocations_query %} | ||
| select | ||
| invocation_id, | ||
| command, | ||
| selected, | ||
| full_refresh, | ||
| {% if column_exists %} | ||
| job_url, | ||
| {% endif %} | ||
| job_name, | ||
| job_id, | ||
| orchestrator | ||
| from {{ invocations_relation }} | ||
| where invocation_id in {{ elementary.strings_list_to_tuple(ids) }} | ||
| {% endset %} | ||
| {% set result = elementary.run_query(get_invocations_query) %} | ||
| {% do return(elementary.agate_to_dicts(result)) %} | ||
| {% endif %} | ||
| {% endmacro %} |
21 changes: 21 additions & 0 deletions
21
elementary/monitor/dbt_project/macros/get_resources_latest_invocation.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| {% macro get_resources_latest_invocation() %} | ||
| {% set dbt_run_results = ref('dbt_run_results') %} | ||
| {% set get_resources_latest_invocation_query %} | ||
| with ordered_run_results as ( | ||
| select | ||
| *, | ||
| ROW_NUMBER() OVER (PARTITION BY unique_id ORDER BY generated_at DESC) AS row_number | ||
| from {{ dbt_run_results }} | ||
| ), | ||
|
|
||
| latest_run_results as ( | ||
| select * | ||
| from ordered_run_results | ||
| where row_number = 1 | ||
| ) | ||
|
|
||
| select unique_id, invocation_id from latest_run_results | ||
| {% endset %} | ||
| {% set run_invocations_agate = run_query(get_resources_latest_invocation_query) %} | ||
| {% do return(elementary.agate_to_dicts(run_invocations_agate)) %} | ||
| {% endmacro %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need both of the new objects at the front?