-
Notifications
You must be signed in to change notification settings - Fork 15
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
Source Asana: Add dbt converter #53
Merged
marcosmarxm
merged 9 commits into
airbytehq:main
from
pangeran-bottor:source-asana-dbt-converter
Sep 3, 2024
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c32aa8c
prepare deps and integration tests
pangeran-bottor 78c7aec
add column descriptions
pangeran-bottor 28fe48c
change back profile to airbyte and asana vars
pangeran-bottor 72115b7
initial model: project
pangeran-bottor bc4a399
project, task, and user converter
pangeran-bottor debfda0
section, story, tag, team models
pangeran-bottor 23890ac
fix sql statements
marcosmarxm 7671f58
models for junction tables
pangeran-bottor 54260ab
fix json_value parse columns
marcosmarxm 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 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 |
---|---|---|
|
@@ -20,7 +20,7 @@ clean-targets: | |
- logs | ||
|
||
require-dbt-version: | ||
- '>=1.0.0' | ||
- ">=1.0.0" | ||
- <2.0.0 | ||
|
||
models: | ||
|
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,43 @@ | ||
name: integration_test_asana | ||
|
||
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_asana: | ||
materialized: view | ||
+schema: dbt_asana | ||
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_asana" | ||
|
||
# Required by Fivetran dbt model | ||
asana_database: "airbyte_db_default" | ||
asana_schema: "airbyte_dbt_asana" |
11 changes: 11 additions & 0 deletions
11
connectors/source_asana/integration_tests/package-lock.yml
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,11 @@ | ||
packages: | ||
- local: ../ | ||
- package: fivetran/asana | ||
version: 0.8.1 | ||
- package: fivetran/asana_source | ||
version: 0.8.0 | ||
- package: fivetran/fivetran_utils | ||
version: 0.4.10 | ||
- package: dbt-labs/dbt_utils | ||
version: 1.2.0 | ||
sha1_hash: fc497513774e493a6374e162f78845f94d8ed0c9 |
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,5 @@ | ||
packages: | ||
- local: ../ | ||
|
||
- package: fivetran/asana | ||
version: [">=0.8.0", "<0.9.0"] |
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 @@ | ||
{airbyte_database: $AB_DB, amplitude_database: $AB_DB} |
26 changes: 26 additions & 0 deletions
26
connectors/source_asana/models/fivetran_converter/project.sql
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,26 @@ | ||
{% if target.type == "snowflake" %} | ||
|
||
{% elif target.type == "bigquery" %} | ||
WITH tmp AS ( | ||
SELECT | ||
t.gid as id, | ||
t.archived, | ||
t.created_at, | ||
t.current_status, | ||
t.due_date, | ||
t.modified_at, | ||
t.name, | ||
JSON_QUERY(t.owner, '$.gid') as owner_id, | ||
t.public, | ||
JSON_QUERY(t.team, '$.gid') as team_id, | ||
JSON_QUERY(t.workspace, '$.gid') as workspace_id, | ||
t.notes | ||
FROM | ||
{{ source('source_asana', 'projects') }} t | ||
) | ||
SELECT * FROM tmp | ||
|
||
|
||
{% elif target.type == "postgres" %} | ||
|
||
{%endif%} |
37 changes: 37 additions & 0 deletions
37
connectors/source_asana/models/fivetran_converter/project.yaml
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,37 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: project | ||
schema: "{{ var('airbyte_schema', target.schema) }}" | ||
database: "{{ var('airbyte_database', target.database) }}" | ||
identifier: "{{ var('asana_project_identifier', 'project') }}" | ||
description: All fields and field values associated with project. | ||
config: | ||
+enabled: "{{ var('using_fivetran_model', False) }}" | ||
columns: | ||
- name: id | ||
description: System generated unique ID of the project. | ||
- name: archived | ||
description: Boolean representing whether the project has been archived (removed from asana UI). | ||
- name: color | ||
description: Color of the project as seen in the UI. | ||
- name: created_at | ||
description: Timestamp of when the story was made/the action was logged. | ||
- name: current_status | ||
description: The most recent progress status update for the project. This is sent to all project followers. | ||
- name: due_date | ||
description: The date the project is due. | ||
- name: modified_at | ||
description: The last time the project was updated. Does not include comments nor changes in associations (ie new tasks). | ||
- name: name | ||
description: The given name of the project. | ||
- name: notes | ||
description: Free-form textual notes associated with the project. | ||
- name: owner_id | ||
description: Foreign key referencing the USER who owns the project. | ||
- name: public | ||
description: Boolean that is true if the project is public to the whole organization, false if not. | ||
- name: team_id | ||
description: Foreign key referencing the TEAM that the project is shared with. | ||
- name: workspace_id | ||
description: The id of an organization's workspace in asana. Not necessary unless you have access to multiple asana workspaces. |
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
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.
Nice start @pangeran-bottor you can use Chatgpt to translate to snowflake and postgres.