Skip to content

Commit

Permalink
Merge pull request #22 from fivetran/feature/labels-addition
Browse files Browse the repository at this point in the history
Feature/Label-Source-Addition
  • Loading branch information
fivetran-joemarkiewicz authored Feb 17, 2022
2 parents eb6d313 + 26feb8e commit 0ce42c2
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 238 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# dbt_github_source v0.5.0

## 🚨 Breaking Changes 🚨
- Addition of the `label` source table. This was necessary as the `issue_label` depreciated the `label` column. The respective label information will now be synced within the `label` table. ([#22](https://github.com/fivetran/dbt_github_source/pull/22))
- If you do not have the new `label` table in your source, we highly recommend you enable schema changes on your connector and kick off a resync to see the new tables reflected in your source.
# dbt_github_source v0.4.1

## Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Include in your `packages.yml`
```yaml
packages:
- package: fivetran/github_source
version: [">=0.4.0", "<0.5.0"]
version: [">=0.5.0", "<0.6.0"]
```
## Configuration
Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'github_source'
version: '0.4.1'
version: '0.5.0'

require-dbt-version: [">=1.0.0", "<2.0.0"]

Expand All @@ -17,6 +17,7 @@ vars:
issue_closed_history: "{{ source('github', 'issue_closed_history') }}"
issue_comment: "{{ source('github', 'issue_comment') }}"
issue_label: "{{ source('github', 'issue_label') }}"
label: "{{ source('github', 'label') }}"
issue_merged: "{{ source('github', 'issue_merged') }}"
issue: "{{ source('github', 'issue') }}"
pull_request_review: "{{ source('github', 'pull_request_review') }}"
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/run_results.json

This file was deleted.

10 changes: 9 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'github_source_integration_tests'
version: '0.4.1'
version: '0.5.0'
config-version: 2

profile: 'integration_tests'
Expand All @@ -10,6 +10,7 @@ vars:
issue_closed_history: "{{ ref('github_issue_closed_history_data') }}"
issue_comment: "{{ ref('github_issue_comment_data') }}"
issue_label: "{{ ref('github_issue_label_data') }}"
label: "{{ ref('github_label_data') }}"
issue_merged: "{{ ref('github_issue_merged_data') }}"
issue: "{{ ref('github_issue_data') }}"
pull_request_review: "{{ ref('github_pull_request_review_data') }}"
Expand All @@ -33,6 +34,13 @@ seeds:
github_issue_merged_data:
+column_types:
merged_at: timestamp
github_issue_label_data:
+column_types:
issue_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
label_id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
github_label_data:
+column_types:
id: "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"
github_issue_data:
+column_types:
closed_at: timestamp
Expand Down
248 changes: 47 additions & 201 deletions integration_tests/seeds/github_issue_label_data.csv
Original file line number Diff line number Diff line change
@@ -1,201 +1,47 @@
issue_id,label,_fivetran_synced
10000,Commercial art gallery manager,2019-03-08 12:51:21
10001,Chartered public finance accountant,2020-09-05 10:50:39
10002,Biomedical scientist,2020-08-26 15:51:15
10003,Diplomatic Services operational officer,2019-01-05 17:45:45
10004,Aid worker,2020-06-16 15:43:43
10005,Dietitian,2019-01-05 17:19:27
10006,Sport and exercise psychologist,2020-08-04 11:14:44
10007,"Engineer, communications",2019-12-21 14:05:23
10008,Musician,2019-05-06 05:05:27
10009,"Engineer, land",2020-10-20 16:47:08
10010,Ranger/warden,2019-11-23 01:29:10
10011,Tourism officer,2019-06-24 17:48:37
10012,"Producer, television/film/video",2019-08-17 21:57:02
10013,Microbiologist,2020-02-13 14:01:34
10014,"Lighting technician, broadcasting/film/video",2019-02-01 05:51:11
10015,Equities trader,2020-07-13 13:38:28
10016,Product designer,2020-05-09 20:13:03
10017,"Scientist, water quality",2019-05-27 06:57:41
10018,Chiropractor,2019-05-06 06:22:42
10019,Hydrogeologist,2019-05-16 22:58:46
10020,Quantity surveyor,2019-05-11 05:44:58
10021,Trading standards officer,2019-09-08 01:47:02
10022,Pharmacologist,2020-11-19 14:01:27
10023,"Education officer, community",2020-03-04 01:11:16
10024,Financial risk analyst,2020-05-06 17:22:16
10025,Biomedical scientist,2019-11-13 00:41:34
10026,Minerals surveyor,2020-06-15 20:13:05
10027,"Psychologist, educational",2020-01-30 18:58:50
10028,"Librarian, academic",2019-09-19 07:55:42
10029,"Therapist, occupational",2019-05-28 21:32:34
10030,Hotel manager,2019-02-08 04:28:38
10031,Market researcher,2020-02-15 01:12:45
10032,Archaeologist,2020-11-14 15:10:09
10033,Holiday representative,2019-02-15 00:05:20
10034,Hospital doctor,2019-10-17 08:42:07
10035,Agricultural engineer,2019-11-26 17:19:50
10036,Chiropodist,2019-02-28 20:12:00
10037,Data processing manager,2020-10-07 17:53:22
10038,Early years teacher,2019-02-03 12:43:36
10039,Chartered management accountant,2020-02-01 06:03:43
10040,Volunteer coordinator,2019-06-13 13:12:06
10041,Adult nurse,2019-10-05 19:33:47
10042,Rural practice surveyor,2020-05-02 15:51:15
10043,Medical sales representative,2020-11-17 08:00:22
10044,"Conservator, furniture",2019-08-14 08:58:39
10045,Armed forces technical officer,2020-08-13 04:05:19
10046,Music tutor,2020-06-05 04:55:32
10047,Freight forwarder,2019-03-28 00:25:47
10048,"Journalist, newspaper",2018-12-31 05:50:53
10049,Bookseller,2019-05-04 07:17:29
10050,"Psychotherapist, dance movement",2020-05-06 03:46:31
10051,"Designer, multimedia",2020-02-06 07:15:31
10052,Government social research officer,2020-07-21 06:33:52
10053,Immigration officer,2020-04-18 03:37:55
10054,"Pharmacist, community",2019-06-10 10:30:58
10055,Horticultural consultant,2020-10-28 05:29:14
10056,Manufacturing systems engineer,2020-10-29 21:40:25
10057,Geophysicist/field seismologist,2019-07-25 11:03:05
10058,Advice worker,2020-10-25 23:48:22
10059,Management consultant,2019-04-18 23:53:03
10060,Archaeologist,2020-05-13 16:56:09
10061,Facilities manager,2020-05-12 12:09:23
10062,Systems developer,2019-04-09 18:55:27
10063,Health and safety inspector,2020-09-20 10:29:01
10064,"Therapist, speech and language",2019-08-16 09:20:17
10065,Barista,2020-09-13 00:21:49
10066,Geophysicist/field seismologist,2019-09-13 02:57:10
10067,Merchant navy officer,2018-11-20 12:14:00
10068,Cytogeneticist,2020-01-19 12:53:54
10069,Risk manager,2019-02-10 21:35:47
10070,"Lecturer, further education",2019-03-09 15:17:13
10071,Haematologist,2020-08-31 00:19:32
10072,Insurance broker,2019-12-18 08:28:16
10073,Production engineer,2019-08-02 18:35:49
10074,"Engineer, structural",2020-10-13 13:16:36
10075,Dietitian,2019-08-25 21:40:48
10076,Manufacturing engineer,2019-01-15 16:55:19
10077,Interior and spatial designer,2020-06-21 14:21:32
10078,Adult nurse,2020-06-17 05:43:22
10079,Sports coach,2020-07-30 02:30:43
10080,Museum/gallery exhibitions officer,2019-06-23 04:09:05
10081,Civil Service fast streamer,2020-09-24 12:59:56
10082,Physiological scientist,2020-08-17 01:13:26
10083,Pension scheme manager,2019-05-11 12:12:57
10084,"Solicitor, Scotland",2019-05-29 15:41:56
10085,Site engineer,2020-09-29 21:37:34
10086,"Optician, dispensing",2019-10-02 18:23:03
10087,Fast food restaurant manager,2020-01-22 11:49:54
10088,Newspaper journalist,2019-10-08 16:42:37
10089,"Designer, furniture",2020-09-13 19:50:35
10090,Science writer,2019-02-05 03:06:51
10091,"Teacher, English as a foreign language",2020-04-10 19:53:42
10092,Medical technical officer,2020-07-16 02:01:41
10093,"Programmer, multimedia",2019-08-27 08:46:51
10094,Textile designer,2020-07-12 13:31:07
10095,Toxicologist,2019-07-12 06:45:51
10096,English as a second language teacher,2019-06-05 18:07:57
10097,Accommodation manager,2019-04-04 23:47:08
10098,Colour technologist,2020-05-21 01:32:19
10099,Retail banker,2019-07-15 06:02:47
10100,Field seismologist,2020-04-21 18:48:46
10101,Counselling psychologist,2020-07-02 03:18:58
10102,"Engineer, civil (consulting)",2019-02-23 14:48:22
10103,Medical secretary,2019-01-23 06:16:54
10104,Futures trader,2019-10-19 19:02:34
10105,"Designer, interior/spatial",2020-06-10 13:20:44
10106,Oncologist,2019-07-17 16:57:43
10107,Special effects artist,2020-05-21 08:07:02
10108,Lawyer,2019-08-07 18:44:37
10109,Multimedia programmer,2019-06-29 09:00:11
10110,"Journalist, newspaper",2019-03-22 02:10:49
10111,Financial planner,2019-06-07 00:06:17
10112,"Physicist, medical",2020-05-06 08:17:16
10113,Furniture designer,2020-09-02 16:27:42
10114,Insurance claims handler,2019-07-06 12:57:36
10115,Optometrist,2019-11-20 20:50:39
10116,Barrister's clerk,2020-06-15 22:10:23
10117,"Scientist, water quality",2020-07-18 02:33:15
10118,"Designer, textile",2020-09-21 14:44:03
10119,Armed forces training and education officer,2019-06-02 05:48:29
10120,Engineering geologist,2019-11-08 12:24:46
10121,Horticultural consultant,2019-09-18 16:25:58
10122,Dramatherapist,2019-05-15 20:28:37
10123,Marine scientist,2019-12-19 19:15:37
10124,Site engineer,2019-08-10 21:19:58
10125,"Designer, furniture",2019-05-10 09:40:38
10126,Armed forces operational officer,2019-03-27 18:04:34
10127,Trading standards officer,2019-08-19 11:16:58
10128,"Conservator, furniture",2020-01-20 16:28:26
10129,Occupational hygienist,2019-01-05 22:41:00
10130,Patent examiner,2019-12-01 21:01:57
10131,Tourism officer,2020-10-27 18:57:58
10132,"Engineer, electronics",2020-03-02 23:58:46
10133,"Teacher, adult education",2020-07-26 18:21:29
10134,Quantity surveyor,2018-12-18 14:00:43
10135,Building control surveyor,2020-04-26 21:17:38
10136,"Scientist, water quality",2019-08-02 19:15:47
10137,Broadcast presenter,2019-10-21 10:11:25
10138,Accounting technician,2020-02-21 07:28:57
10139,"Restaurant manager, fast food",2020-07-01 02:59:04
10140,Estate manager/land agent,2019-03-13 17:24:14
10141,Television production assistant,2019-04-18 10:59:42
10142,Heritage manager,2019-11-07 07:18:27
10143,"Therapist, nutritional",2019-02-21 01:23:10
10144,"Development worker, international aid",2020-11-19 05:26:14
10145,"Merchandiser, retail",2020-06-18 19:32:34
10146,Industrial/product designer,2020-06-11 08:48:56
10147,Marine scientist,2019-02-20 20:42:48
10148,Immigration officer,2019-08-22 07:01:00
10149,Chartered legal executive (England and Wales),2020-03-11 15:09:07
10150,Make,2019-08-22 23:56:42
10151,Warehouse manager,2019-07-26 20:48:47
10152,"Engineer, water",2020-08-08 18:59:52
10153,Video editor,2020-08-09 05:16:52
10154,Town planner,2020-03-10 19:52:41
10155,"Producer, television/film/video",2020-03-23 13:56:33
10156,Furniture conservator/restorer,2019-11-15 12:04:49
10157,Warden/ranger,2018-12-12 02:00:13
10158,Water quality scientist,2019-05-11 21:49:39
10159,Trading standards officer,2019-12-24 14:50:26
10160,Commercial horticulturist,2019-01-07 21:30:44
10161,"Engineer, manufacturing",2018-12-07 18:33:08
10162,Sports development officer,2019-07-21 03:12:49
10163,"Engineer, mining",2020-06-11 03:24:49
10164,Newspaper journalist,2020-04-06 07:46:20
10165,Contracting civil engineer,2020-03-02 23:14:20
10166,Higher education careers adviser,2019-10-21 20:52:27
10167,Medical sales representative,2020-05-17 14:55:04
10168,Paediatric nurse,2019-03-05 07:10:24
10169,Dealer,2019-08-27 08:53:30
10170,Tax inspector,2020-04-27 02:32:08
10171,Equality and diversity officer,2020-04-07 13:57:23
10172,"Therapist, music",2020-06-29 09:16:43
10173,Chief Operating Officer,2020-01-20 06:18:33
10174,"Programmer, applications",2020-06-16 23:57:05
10175,Retail buyer,2020-03-31 18:51:20
10176,"Conservation officer, historic buildings",2020-03-01 14:27:40
10177,Clinical biochemist,2020-05-05 02:43:31
10178,"Therapist, art",2019-08-03 01:31:03
10179,"Accountant, chartered certified",2019-04-22 01:25:23
10180,Economist,2020-06-22 05:27:46
10181,Plant breeder/geneticist,2020-07-03 03:36:49
10182,Financial planner,2019-12-25 05:02:42
10183,"Scientist, research (maths)",2020-01-08 21:31:53
10184,"Therapist, art",2019-04-25 11:10:30
10185,Advertising copywriter,2020-07-19 04:53:56
10186,General practice doctor,2019-08-22 10:43:01
10187,"Surveyor, building",2018-12-07 12:06:46
10188,Economist,2020-08-21 16:24:00
10189,Advertising art director,2019-04-14 21:33:30
10190,Control and instrumentation engineer,2019-08-23 01:52:24
10191,Sports coach,2019-05-12 05:16:55
10192,Data processing manager,2018-12-23 18:03:04
10193,Corporate treasurer,2020-05-25 01:06:12
10194,Naval architect,2020-07-16 03:54:34
10195,Banker,2019-11-09 21:07:24
10196,"Engineer, biomedical",2020-05-22 09:41:43
10197,Contracting civil engineer,2019-08-20 11:59:15
10198,Network engineer,2020-08-15 07:20:26
10199,Field seismologist,2020-09-28 17:08:23
issue_id,label_id,_fivetran_synced
1010036650,2856837944,2022-02-10 18:24:00
1001276673,2856837944,2022-02-10 18:24:01
1003166652,2856837951,2022-02-10 18:24:00
948991839,2856837951,2022-02-10 18:23:58
1114358929,2059419262,2022-02-10 18:29:53
749294797,2059419264,2022-02-10 18:29:45
784478237,2059419268,2022-02-10 18:29:46
749294797,2059419268,2022-02-10 18:29:45
1078710769,2059419268,2022-02-10 18:29:52
799777307,2059419268,2022-02-10 18:29:46
1123575469,2059419268,2022-02-10 18:29:54
975091470,2928211862,2022-02-10 18:25:40
861408152,2928211862,2022-02-10 18:25:38
1073641143,2022377937,2022-02-10 18:28:34
892073714,2022377937,2022-02-10 18:28:33
1073648251,2022377937,2022-02-10 18:28:35
1073645679,2022377937,2022-02-10 18:28:35
799777187,2022377948,2022-02-10 18:28:31
1073641143,2022377951,2022-02-10 18:28:34
1073648251,2022377951,2022-02-10 18:28:35
1073645679,2022377951,2022-02-10 18:28:35
1067574582,2317462247,2022-02-10 18:25:44
1038983284,2317462247,2022-02-10 18:25:49
957845900,2317462247,2022-02-10 18:25:39
1067615919,2317462247,2022-02-10 18:25:47
973111929,2317462247,2022-02-10 18:25:41
1067725298,2317462247,2022-02-10 18:25:46
1067589151,2317462247,2022-02-10 18:25:46
964992665,2317462247,2022-02-10 18:25:41
906465246,2317462247,2022-02-10 18:25:39
1067729023,2317462247,2022-02-10 18:25:48
1000259452,2317462247,2022-02-10 18:25:42
1042913422,2317462249,2022-02-10 18:25:43
1067729023,2317462249,2022-02-10 18:25:48
1067589151,2317462249,2022-02-10 18:25:46
1067589151,2317462253,2022-02-10 18:25:46
1045154146,2317462253,2022-02-10 18:25:43
954295166,2317462253,2022-02-10 18:25:42
1067615919,2317462253,2022-02-10 18:25:47
1067729023,2317462253,2022-02-10 18:25:48
1065348246,2317462258,2022-02-10 18:25:48
896491757,2317462258,2022-02-10 18:25:36
1125728723,2317462247,2022-02-10 20:21:01
1127568994,2059419262,2022-02-10 20:21:09
1098052157,2856837958,2022-02-10 20:20:59
1112949714,2022377937,2022-02-10 20:21:07
16 changes: 16 additions & 0 deletions integration_tests/seeds/github_label_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
id,_fivetran_synced,color,description,is_default,name,url
2928211862,2022-02-10 18:25:38,5030D6,Customer request for an added feature,FALSE,feature request,https://api.github.com/repos/fivetran/dbt_jira/labels/feature%20request
2059419264,2022-02-10 18:29:45,0075ca,Improvements or additions to documentation,TRUE,documentation,https://api.github.com/repos/fivetran/dbt_github_source/labels/documentation
2317462249,2022-02-10 18:25:43,0075ca,Improvements or additions to documentation,TRUE,documentation,https://api.github.com/repos/fivetran/dbt_jira/labels/documentation
2022377955,2022-02-10 18:28:35,8672,Extra attention is needed,TRUE,help wanted,https://api.github.com/repos/fivetran/dbt_github/labels/help%20wanted
2022377951,2022-02-10 18:28:34,7057ff,Good for newcomers,TRUE,good first issue,https://api.github.com/repos/fivetran/dbt_github/labels/good%20first%20issue
2059419268,2022-02-10 18:29:45,a2eeef,New feature or request,TRUE,enhancement,https://api.github.com/repos/fivetran/dbt_github_source/labels/enhancement
2856837951,2022-02-10 18:23:58,a2eeef,New feature or request,TRUE,enhancement,https://api.github.com/repos/fivetran/dbt_iterable/labels/enhancement
2022377948,2022-02-10 18:28:31,a2eeef,New feature or request,TRUE,enhancement,https://api.github.com/repos/fivetran/dbt_github/labels/enhancement
2317462253,2022-02-10 18:25:42,a2eeef,New feature or request,TRUE,enhancement,https://api.github.com/repos/fivetran/dbt_jira/labels/enhancement
2856837944,2022-02-10 18:24:00,d73a4a,Something isn't working,TRUE,bug,https://api.github.com/repos/fivetran/dbt_iterable/labels/bug
2022377937,2022-02-10 20:21:07,d73a4a,Something isn't working,TRUE,bug,https://api.github.com/repos/fivetran/dbt_github/labels/bug
2317462247,2022-02-10 20:21:01,d73a4a,Something isn't working,TRUE,bug,https://api.github.com/repos/fivetran/dbt_jira/labels/bug
2059419262,2022-02-10 20:21:09,d73a4a,Something isn't working,TRUE,bug,https://api.github.com/repos/fivetran/dbt_github_source/labels/bug
2856837958,2022-02-10 20:20:59,d876e3,Further information is requested,TRUE,question,https://api.github.com/repos/fivetran/dbt_iterable/labels/question
2317462258,2022-02-10 18:25:36,d876e3,Further information is requested,TRUE,question,https://api.github.com/repos/fivetran/dbt_jira/labels/question
2 changes: 1 addition & 1 deletion macros/get_issue_label_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "label", "datatype": dbt_utils.type_string()},
{"name": "label_id", "datatype": dbt_utils.type_int()},
{"name": "issue_id", "datatype": dbt_utils.type_int()}
] %}

Expand Down
15 changes: 15 additions & 0 deletions macros/get_label_columns.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% macro get_label_columns() %}

{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "color", "datatype": dbt_utils.type_string()},
{"name": "description", "datatype": dbt_utils.type_string()},
{"name": "id", "datatype": dbt_utils.type_int()},
{"name": "is_default", "datatype": "boolean"},
{"name": "name", "datatype": dbt_utils.type_string()},
{"name": "url", "datatype": dbt_utils.type_string()}
] %}

{{ return(columns) }}

{% endmacro %}
Loading

0 comments on commit 0ce42c2

Please sign in to comment.