diff --git a/connectors/source_github/README.md b/connectors/source_github/README.md index b4aa037e..47aae39f 100644 --- a/connectors/source_github/README.md +++ b/connectors/source_github/README.md @@ -1,9 +1,92 @@ -# Airbyte source_github dbt Package +# Github Airbyte dbt Package -This package contains dbt models for Airbyte source_github source. +--- -What it includes: +- This package contains dbt models to work with Airbyte Github connector. +- The package is compatible with latest version of Airbyte Github connector. +- Currently, it is limited to creating transformations compatible with [Fivetran's modeling dbt package](https://github.com/fivetran/dbt_github/tree/main). +- In the future, specific models will be applied directly to Airbyte connector output. If you have an idea or want to propose an analytical model for this source, please refer to the contributing guide, which explains how to propose a new transformation model. +- This package was tested with BigQuery, Snowflake, and Postgres data warehouses. -* A complete source description -* ERD model for the source -* Diagram documentation for the source +--- + +## 🎯 Intructions how to use + +### Airbyte dbt Package + +For now Airbyte dbt packages aren't versioned. You must configure using git and subdirectory. For now there isn't any transformation model directly applied to this package. But you can generate docs and tests with dbt. + +Create the following files: + +**`dbt_project.yml`** + +```yaml +vars: + using_fivetran_model: False + airbyte_database: "airbyte_db_default" + airbyte_schema: "airbyte_dbt_github" +``` + +**`packages.yml`** + +```yaml +packages: + - git: "https://github.com/airbytehq/airbyte-dbt-models.git" + subdirectory: "connectors/source_github" +``` + +After you can run `dbt tests` or `dbt docs generate` to have a preview of Airbyte output data. + +### Fivetran Github Modeling dbt package + +This package transforms Airbyte connector output data, making it compatible with Fivetran's Github dbt package. You can check the analytical models Fivetran creates [here](https://github.com/fivetran/dbt_github/tree/main?tab=readme-ov-file#-what-does-this-dbt-package-do). The link also provides information about how the package works and what is configurable. + +Create the require files to use Airbyte and Fivetran dbt packages: + +**`packages.yml`** + +```yaml +packages: + - git: "https://github.com/airbytehq/airbyte-dbt-models.git" + subdirectory: "connectors/source_github_support" + + - package: fivetran/github + version: [">=0.16.0", "<0.17.0"] +``` + +This is a default variable definition you must configure to have the models created. +At the moment this package doesn't support (schedules, domains, user tags, ticket form history and organization tags) for that reason keep those variables set to `False`. +Variables starting with the prefix `github_..._identifier` represent the names of tables generated by the Airbyte connector. If you configured your sync with this prefix, ensure you edit it accordingly. + +**`dbt_project.yml`** + +```yaml +vars: + # Required by Airbyte dbt model + using_fivetran_model: True + airbyte_database: "airbyte_db_default" + airbyte_schema: "airbyte_dbt_github_support" + + # Required by Fivetran dbt model + github_database: "airbyte_db_default" + github_schema: "airbyte_dbt_github_support" + + using_repo_team: False + + github_issue_assignee_identifier: "issue_assignee" + github_issue_closed_history_identifier: "issue_closed_history" + github_issue_merged_identifier: "issue_merged" + github_pull_request_review_identifier: "pull_request_review" + github_repo_team_identifier: "repo_team" + github_requested_reviewer_history_identifier: "requested_reviewer_history" + +``` + +After run `dbt run`, you can see the models being created. + +--- + +## :package: Package Maintenance + +- This package is maintained by the Airbyte Community. +- You can contribute any time please read the Contributing Guidelines or enter the Airbyte Slack Channel `#airbyte-dbt-packages` diff --git a/connectors/source_github/dbt_project.yml b/connectors/source_github/dbt_project.yml index b470c08b..6542eab9 100644 --- a/connectors/source_github/dbt_project.yml +++ b/connectors/source_github/dbt_project.yml @@ -25,10 +25,11 @@ require-dbt-version: models: source_github: - materialized: table + materialized: view staging: materialized: view vars: - database: snowflake - schema: source_github + database: airbyte_dbt_default + schema: airbyte_schema_default + using_fivetran: False diff --git a/connectors/source_github/integration_tests/dbt_project.yml b/connectors/source_github/integration_tests/dbt_project.yml new file mode 100644 index 00000000..5bd7da6d --- /dev/null +++ b/connectors/source_github/integration_tests/dbt_project.yml @@ -0,0 +1,45 @@ +name: integration_test_github + +config-version: 2 + +version: 0.1.0 + +profile: integration_tests + +model-paths: + - models + +macro-paths: + - macros + +target-path: target + +clean-targets: + - target + - dbt_modules + - logs + +require-dbt-version: + - ">=1.0.0" + - <2.0.0 + +models: + airbyte_dbt_source_github: + materialized: view + +schema: dbt_github + staging: + materialized: view + tmp: + materialized: view + +vars: + # Required by Airbyte dbt model + using_fivetran_model: True + airbyte_database: "airbyte_db_default" + airbyte_schema: "airbyte_dbt_github" + + # Required by Github dbt model + github_database: "airbyte_db_default" + github_schema: "airbyte_dbt_github" + + using_repo_team: False diff --git a/connectors/source_github/integration_tests/vars b/connectors/source_github/integration_tests/vars new file mode 100644 index 00000000..77da5cbb --- /dev/null +++ b/connectors/source_github/integration_tests/vars @@ -0,0 +1 @@ +{airbyte_database: $AB_DB, github_database: $AB_DB} \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue.sql b/connectors/source_github/models/fivetran_converter/issue.sql new file mode 100644 index 00000000..d62b95e2 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue.sql @@ -0,0 +1,15 @@ +select + cast(id as {{ dbt.type_string() }}) as id, + body, + closed_at, + created_at, + locked, + {{ fivetran_utils.json_extract('milestone', 'id') }} as milestone_id, + number, + pull_request, + repository as repository_id, + state, + title, + updated_at, + {{ fivetran_utils.json_extract('"user"', 'id') }} as user_id +from {{ source('source_github', 'issues') }} \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue.yml b/connectors/source_github/models/fivetran_converter/issue.yml new file mode 100644 index 00000000..aaee753f --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue.yml @@ -0,0 +1,35 @@ +version: 2 + +models: + - name: issue + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_merged_identifier', 'issue') }}" + description: "A model that extracts and transforms GitHub issues data from the source table." + columns: + - name: issue_id + description: "Unique identifier for each GitHub issue." + - name: body + description: "The body text of the GitHub issue." + - name: closed_at + description: "The timestamp when the GitHub issue was closed." + - name: created_at + description: "The timestamp when the GitHub issue was created." + - name: locked + description: "Indicates if the GitHub issue is locked." + - name: milestone_id + description: "The unique identifier for the milestone associated with the GitHub issue." + - name: number + description: "The issue number for the GitHub repository." + - name: pull_request + description: "Indicates if the GitHub issue is a pull request." + - name: repository_id + description: "The unique identifier for the repository where the GitHub issue resides." + - name: state + description: "The state of the GitHub issue (e.g., open, closed)." + - name: title + description: "The title of the GitHub issue." + - name: updated_at + description: "The timestamp when the GitHub issue was last updated." + - name: user_id + description: "The unique identifier for the user who created the GitHub issue." diff --git a/connectors/source_github/models/fivetran_converter/issue_assignee.sql b/connectors/source_github/models/fivetran_converter/issue_assignee.sql new file mode 100644 index 00000000..1e756e1d --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_assignee.sql @@ -0,0 +1,8 @@ +with tmp as ( + SELECT + cast(id as {{ dbt.type_string() }}) as issue_id, + {{ fivetran_utils.json_extract('assignee', 'id') }} as user_id + FROM + {{ source('source_github', 'issues') }} + ) +select * from tmp \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue_assignee.yml b/connectors/source_github/models/fivetran_converter/issue_assignee.yml new file mode 100644 index 00000000..62c3acec --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_assignee.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: issue_assignee + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_assignee_identifier', 'issue_assignee') }}" + description: All fields and field values associated with issue assignees. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: issue_id + description: The ID of the issue associated with the field. + - name: user_id + description: The ID of the user assigned to the issue. diff --git a/connectors/source_github/models/fivetran_converter/issue_closed_history.sql b/connectors/source_github/models/fivetran_converter/issue_closed_history.sql new file mode 100644 index 00000000..bfd925eb --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_closed_history.sql @@ -0,0 +1,9 @@ +with tmp as ( + SELECT + cast(id as {{ dbt.type_string() }}) as issue_id, + updated_at, + case when closed_at is not null then true else false end as closed + FROM + {{ source('source_github', 'issues') }} + ) +select * from tmp \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue_closed_history.yml b/connectors/source_github/models/fivetran_converter/issue_closed_history.yml new file mode 100644 index 00000000..7edc28a5 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_closed_history.yml @@ -0,0 +1,17 @@ +version: 2 + +models: + - name: issue_closed_history + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_closed_history_identifier', 'issue_closed_history') }}" + description: All fields and field values associated with issues with closed history. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: issue_id + description: The ID of the issue associated with the field. + - name: updated_at + description: The timestamp for when the issue was last modified. + - name: is_closed + description: The boolean for whether the issue is closed or not. diff --git a/connectors/source_github/models/fivetran_converter/issue_comment.sql b/connectors/source_github/models/fivetran_converter/issue_comment.sql new file mode 100644 index 00000000..5e6d12dd --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_comment.sql @@ -0,0 +1,7 @@ +select + cast(c.id as {{ dbt.type_string() }}) as id, + cast(i.id as {{ dbt.type_string() }}) issue_id, + {{ fivetran_utils.json_extract('c."user"', 'id') }} as user_id, + c.created_at +from {{ source('source_github', 'comments') }} c +left join {{ source('source_github', 'issues') }} i on c.issue_url = i.url \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue_comment.yml b/connectors/source_github/models/fivetran_converter/issue_comment.yml new file mode 100644 index 00000000..5e4653d5 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_comment.yml @@ -0,0 +1,19 @@ +version: 2 + +models: + - name: issue_comment + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_assignee_identifier', 'issue_comment') }}" + description: All fields and field values associated with issue assignees. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: The ID of the issue comment. + - name: issue_id + description: The ID of the issue. + - name: user_id + description: The ID of the user made the comment. + - name: created_at + description: Date the comment was made. diff --git a/connectors/source_github/models/fivetran_converter/issue_label.sql b/connectors/source_github/models/fivetran_converter/issue_label.sql new file mode 100644 index 00000000..75640dc4 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_label.sql @@ -0,0 +1,5 @@ +select + cast(id as {{ dbt.type_string() }}) as issue_id, + f.value ->> 'id' as label_id +from {{ source('source_github', 'issues') }} as i +join lateral jsonb_array_elements(i.labels) as f(value) on true \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue_label.yml b/connectors/source_github/models/fivetran_converter/issue_label.yml new file mode 100644 index 00000000..c2fc60cd --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_label.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: issue_label + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_assignee_identifier', 'issue_label') }}" + description: All fields and field values associated with issue assignees. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: issue_id + description: The ID of the issue associated with the field. + - name: label_id + description: The ID of the label to the issue. diff --git a/connectors/source_github/models/fivetran_converter/issue_merged.sql b/connectors/source_github/models/fivetran_converter/issue_merged.sql new file mode 100644 index 00000000..326a90e4 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_merged.sql @@ -0,0 +1,5 @@ +SELECT + cast(id as {{ dbt.type_string() }}) as issue_id, + {{ fivetran_utils.json_extract('pull_request', 'merged_at') }} as merged_at +FROM + {{ source('source_github', 'issues') }} \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/issue_merged.yml b/connectors/source_github/models/fivetran_converter/issue_merged.yml new file mode 100644 index 00000000..7258157b --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/issue_merged.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: issue_merged + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_merged_identifier', 'issue_merged') }}" + description: All fields and field values associated with issues with issues merged. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: issue_id + description: The ID of the issue associated with the field. + - name: merged_at + description: The timestamp for when the issue was merged. diff --git a/connectors/source_github/models/fivetran_converter/label.sql b/connectors/source_github/models/fivetran_converter/label.sql new file mode 100644 index 00000000..270e40a9 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/label.sql @@ -0,0 +1,8 @@ +select + cast(id as {{ dbt.type_string() }}) as id, + color, + description, + "default" as is_default, + name, + url +from {{ source('source_github', 'issue_labels') }} \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/label.yml b/connectors/source_github/models/fivetran_converter/label.yml new file mode 100644 index 00000000..974feaf9 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/label.yml @@ -0,0 +1,23 @@ +version: 2 + +models: + - name: label + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_merged_identifier', 'label') }}" + description: "All labels associated with GitHub issues." + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: "The unique identifier of the label." + - name: color + description: "The color code associated with the label." + - name: description + description: "A textual description of the label." + - name: is_default + description: "Indicates if the label is the default label." + - name: name + description: "The name of the label." + - name: url + description: "The URL linking to the label in GitHub." diff --git a/connectors/source_github/models/fivetran_converter/pull_request.sql b/connectors/source_github/models/fivetran_converter/pull_request.sql new file mode 100644 index 00000000..4fd9c0a5 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/pull_request.sql @@ -0,0 +1,7 @@ +select + cast(pr.id as {{ dbt.type_string() }}) as id, + cast(i.id as {{ dbt.type_string() }}) as issue_id, + {{ fivetran_utils.json_extract('head', 'repo_id')}} as head_repo_id, + head -> 'user' ->> 'id' as head_user_id +from {{ source('source_github', 'pull_requests') }} as pr +left join {{ source('source_github', 'issues') }} as i on pr.issue_url = i.url \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/pull_request.yml b/connectors/source_github/models/fivetran_converter/pull_request.yml new file mode 100644 index 00000000..cd629c43 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/pull_request.yml @@ -0,0 +1,19 @@ +version: 2 + +models: + - name: pull_request + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_issue_merged_identifier', 'pull_request') }}" + description: "All pull requests" + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: "The unique identifier of the pull request." + - name: issue_id + description: "The unique identifier of the associated issue." + - name: head_repo_id + description: "The unique identifier of the head repository." + - name: head_user_id + description: "The unique identifier of the head user." diff --git a/connectors/source_github/models/fivetran_converter/pull_request_review.sql b/connectors/source_github/models/fivetran_converter/pull_request_review.sql new file mode 100644 index 00000000..8fdd5b34 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/pull_request_review.sql @@ -0,0 +1,10 @@ + +SELECT + cast(r.id as {{ dbt.type_string() }}) as id, + cast(pr.id as {{ dbt.type_string() }}) as pull_request_id, + r.submitted_at, + r.state, + {{ fivetran_utils.json_extract('r."user"', 'id') }} as user_id +FROM {{ source('source_github', 'reviews') }} as r +left join {{ source('source_github', 'pull_requests') }} as pr on r.pull_request_url = pr.url + diff --git a/connectors/source_github/models/fivetran_converter/pull_request_review.yml b/connectors/source_github/models/fivetran_converter/pull_request_review.yml new file mode 100644 index 00000000..b7f8555b --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/pull_request_review.yml @@ -0,0 +1,21 @@ +version: 2 + +models: + - name: pull_request_review + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_pull_request_review_identifier', 'pull_request_review') }}" + description: All fields and field values associated with pull request reviews. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: pull_request_review_id + description: The ID of the issue associated with the field. + - name: pull_request_id + description: The ID of the issue associated with the field. + - name: submitted_at + description: The timestamp for when the issue was last submitted. + - name: state + description: The boolean for whether the pull request is reviewed or not. + - name: user_id + description: The ID of the issue associated with the field. diff --git a/connectors/source_github/models/fivetran_converter/repo_team.sql b/connectors/source_github/models/fivetran_converter/repo_team.sql new file mode 100644 index 00000000..f3640c06 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/repo_team.sql @@ -0,0 +1,8 @@ +WITH tmp AS ( + SELECT + null as repository_id, + null as team_id + FROM + {{ source('source_github', 'teams') }} +) +SELECT * FROM tmp \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/repo_team.yml b/connectors/source_github/models/fivetran_converter/repo_team.yml new file mode 100644 index 00000000..5b59604b --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/repo_team.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: repo_team + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_repo_team_identifier', 'repo_team') }}" + description: All fields and field values associated with repo teams. + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: repository_id + description: The ID of the repo associated with the field. + - name: team_id + description: The ID of the team associated with the field. diff --git a/connectors/source_github/models/fivetran_converter/repository.sql b/connectors/source_github/models/fivetran_converter/repository.sql new file mode 100644 index 00000000..ca70c04e --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/repository.sql @@ -0,0 +1,5 @@ +select + cast(id as {{ dbt.type_string() }}) as id, + private, + full_name +from {{ source('source_github', 'repositories') }} as r \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/repository.yml b/connectors/source_github/models/fivetran_converter/repository.yml new file mode 100644 index 00000000..8659ad16 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/repository.yml @@ -0,0 +1,17 @@ +version: 2 + +models: + - name: repository + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_repo_team_identifier', 'repository') }}" + description: "This model contains all fields and values associated with GitHub repositories and their teams." + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: "The unique identifier of the repository." + - name: private + description: "Indicates whether the repository is private (true) or public (false)." + - name: full_name + description: "The full name of the repository, including the owner (e.g., 'owner/repo_name')." diff --git a/connectors/source_github/models/fivetran_converter/requested_reviewer_history.sql b/connectors/source_github/models/fivetran_converter/requested_reviewer_history.sql new file mode 100644 index 00000000..e6878155 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/requested_reviewer_history.sql @@ -0,0 +1,10 @@ +WITH tmp AS ( + SELECT + cast(id as {{ dbt.type_string() }}) as pull_request_id, + created_at, + null as requested_id, + false as removed + FROM + {{ source('source_github', 'reviews') }} +) +SELECT * FROM tmp \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/requested_reviewer_history.yaml b/connectors/source_github/models/fivetran_converter/requested_reviewer_history.yaml new file mode 100644 index 00000000..3d13e543 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/requested_reviewer_history.yaml @@ -0,0 +1,17 @@ +version: 2 + +models: + - name: requested_reviewer_history + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_requested_reviewer_history_identifier', 'requested_reviewer_history') }}" + description: Table containing when a user requests another user to review a pull request. + columns: + - name: pull_request_id + description: Foreign key that references the pull request table. + - name: created_at + description: Timestamp of when the review was submitted. + - name: requested_id + description: Foreign key that references the user table, representing the user that was requested to review a PR. + - name: removed + description: Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false). \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/team.sql b/connectors/source_github/models/fivetran_converter/team.sql new file mode 100644 index 00000000..82280a71 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/team.sql @@ -0,0 +1,8 @@ +select + cast(id as {{ dbt.type_string() }}) as id, + description, + name, + {{ fivetran_utils.json_extract('parent', 'id')}} as parent_id, + privacy, + slug +from {{ source('source_github', 'teams') }} as t \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/team.yml b/connectors/source_github/models/fivetran_converter/team.yml new file mode 100644 index 00000000..132f68ac --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/team.yml @@ -0,0 +1,23 @@ +version: 2 + +models: + - name: team + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_repo_team_identifier', 'team') }}" + description: "." + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: "The unique identifier of the team." + - name: description + description: "A brief description of the team." + - name: name + description: "The name of the team." + - name: parent_id + description: "The unique identifier of the parent team, if the team is a child of another team." + - name: privacy + description: "The visibility level of the team, such as 'closed' or 'secret'." + - name: slug + description: "The URL-friendly name of the team." diff --git a/connectors/source_github/models/fivetran_converter/user.sql b/connectors/source_github/models/fivetran_converter/user.sql new file mode 100644 index 00000000..2c140a01 --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/user.sql @@ -0,0 +1,6 @@ +select + cast(id as {{ dbt.type_string() }}) as id, + login, + login as name, + organization as company +from {{ source('source_github', 'users') }} as u \ No newline at end of file diff --git a/connectors/source_github/models/fivetran_converter/user.yml b/connectors/source_github/models/fivetran_converter/user.yml new file mode 100644 index 00000000..56470b6a --- /dev/null +++ b/connectors/source_github/models/fivetran_converter/user.yml @@ -0,0 +1,19 @@ +version: 2 + +models: + - name: user + schema: "{{ var('airbyte_schema', target.schema) }}" + database: "{{ var('airbyte_database', target.database) }}" + identifier: "{{ var('github_repo_team_identifier', 'user') }}" + description: "This model represents the users in a GitHub repository, containing information such as user ID, login, name, and associated company." + config: + +enabled: "{{ var('using_fivetran_model', False) }}" + columns: + - name: id + description: "The unique identifier of the user." + - name: login + description: "The login name of the user on GitHub." + - name: name + description: "The display name of the user." + - name: company + description: "The company associated with the user, if provided."