-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c05f81
commit 237ffab
Showing
7 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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,15 @@ | ||
SELECT | ||
id, | ||
state, | ||
title, | ||
created_at, | ||
updated_at, | ||
closed_at, | ||
merged_at, | ||
repository, | ||
author, | ||
TIMESTAMP_DIFF(closed_at, created_at, HOUR) AS time_to_close_hours | ||
FROM | ||
q.stg_pull_requests | ||
WHERE | ||
closed_at IS NOT NULL |
This file contains 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 @@ | ||
models: | ||
- name: pull_requests_time_to_close | ||
columns: | ||
- name: id | ||
description: The pull request identifier. | ||
- name: state | ||
description: The pull request state, either closed or open. | ||
- name: title | ||
description: The pull request title. | ||
- name: created_at | ||
description: The time the pull request was created. | ||
- name: updated_at | ||
description: The time the pull request was last updated. | ||
- name: closed_at | ||
description: The time the pull request was closed. | ||
tests: | ||
- type: not_null | ||
- name: merged_at | ||
description: The time the pull request was merged. | ||
- name: repository | ||
description: The pull request repository. | ||
- name: author | ||
description: The author of the pull request. | ||
- name: time_to_close_hours | ||
description: The time taken to close a pull request. |
This file contains 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,13 @@ | ||
SELECT | ||
repository, | ||
FORMAT_TIMESTAMP('%Y-%U', created_at) AS year_week, | ||
ROUND(AVG(time_to_close_hours)) AS avg_time_to_close, | ||
ROUND(MIN(time_to_close_hours)) AS min_time_to_close, | ||
ROUND(MAX(time_to_close_hours)) AS max_time_to_close, | ||
COUNT(id) AS total_prs_closed | ||
FROM | ||
q.pull_requests_time_to_close | ||
GROUP BY | ||
repository, year_week | ||
ORDER BY | ||
repository, year_week |
This file contains 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 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,17 @@ | ||
SELECT | ||
_airbyte_extracted_at AS _airbyte_extracted_at, | ||
_airbyte_meta AS _airbyte_meta, | ||
_airbyte_raw_id AS _airbyte_raw_id, | ||
author AS author, | ||
branch AS branch, | ||
comments_url AS comments_url, | ||
commit AS commit, | ||
committer AS committer, | ||
created_at AS created_at, | ||
html_url AS html_url, | ||
node_id AS node_id, | ||
parents AS parents, | ||
repository AS repository, | ||
sha AS sha, | ||
url AS url | ||
FROM q.raw_commits |
This file contains 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,13 @@ | ||
SELECT | ||
id, | ||
state, | ||
title, | ||
created_at, | ||
updated_at, | ||
closed_at, | ||
merged_at, | ||
repository, | ||
JSON_VALUE(user, '$.login') AS author, | ||
|
||
FROM | ||
q.raw_pull_requests |
This file contains 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