-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎨 iterate assets and resources (#62)
* feat: 🎨 iterate assets and resources * feat: ⚡️ new allo models * fix: 📝 update paths * chore: 🩹 fix catalog * feat: 🦺 add retrying logic
- Loading branch information
1 parent
831819a
commit 65a246e
Showing
27 changed files
with
3,459 additions
and
3,563 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
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,29 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_applications') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
anchorAddress as anchor_address, | ||
lower(chainId) as chain_id, | ||
createdAtBlock as created_at_block, | ||
createdByAddress as created_by_address, | ||
lower(id) as id, | ||
metadata, | ||
metadata->>'$.signature' as metadata_signature, | ||
lower(metadata->>'$.application.recipient') as metadata_application_recipient, | ||
metadataCid as metadata_cid, | ||
nodeId as node_id, | ||
lower(projectId) as project_id, | ||
lower(roundId) as round_id, | ||
status, | ||
statusSnapshots as status_snapshots, | ||
statusUpdatedAtBlock as status_updated_at_block, | ||
tags, | ||
totalAmountDonatedInUsd as total_amount_donated_in_usd, | ||
totalDonationsCount as total_donations_count, | ||
uniqueDonorsCount as unique_donors_count | ||
from source | ||
) | ||
|
||
select * from renamed |
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 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_deployments') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
lower(address) as address, | ||
chain_name, | ||
contract | ||
from source | ||
) | ||
|
||
select * from renamed |
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,24 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_donations') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
amountInUsd as amount_in_usd, | ||
amount, | ||
amountInRoundMatchToken as amount_in_round_match_token, | ||
applicationId as application_id, | ||
blockNumber as block_number, | ||
chainId as chain_id, | ||
lower(id) as id, | ||
lower(donorAddress) as donor_address, | ||
nodeId as node_id, | ||
lower(projectId) as project_id, | ||
lower(recipientAddress) as recipient_address, | ||
lower(roundId) as round_id, | ||
lower(tokenAddress) as token_address, | ||
lower(transactionHash) as transaction_hash, | ||
from source | ||
) | ||
|
||
select * from renamed |
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 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_prices') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
blockNumber as block_number, | ||
lower(chainId) as chain_id, | ||
id, | ||
nodeId as node_id, | ||
priceInUsd as price_in_usd, | ||
timestamp, | ||
lower(tokenAddress) as token_address, | ||
from source | ||
) | ||
|
||
select * from renamed |
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,34 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_projects') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
anchorAddress as anchor_address, | ||
chainId as chain_id, | ||
createdAtBlock as created_at_block, | ||
lower(createdByAddress) as created_by_address, | ||
id, | ||
metadata as metadata, | ||
metadata->>'title' as title, | ||
metadata->>'description' as description, | ||
metadata->>'website' as website, | ||
metadata->>'projectTwitter' as project_twitter, | ||
metadata->>'projectGithub' as project_github, | ||
metadata->>'userGithub' as user_github, | ||
metadata->>'logoImg' as logo_image, | ||
metadata->>'bannerImg' as banner_image, | ||
cast(metadata->>'createdAt' as numeric) as created_at, | ||
metadataCid as metadata_cid, | ||
name as name, | ||
nodeId as node_id, | ||
nonce, | ||
projectNumber as project_number, | ||
projectType as project_type, | ||
registryAddress as registry_address, | ||
tags, | ||
updatedAtBlock as updated_at_block | ||
from source | ||
) | ||
|
||
select * from renamed |
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,42 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_rounds') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
adminRole as admin_role, | ||
applicationMetadata as application_metadata, | ||
applicationMetadataCid as application_metadata_cid, | ||
applicationsEndTime as applications_end_time, | ||
applicationsStartTime as applications_start_time, | ||
chainId as chain_id, | ||
createdAtBlock as created_at_block, | ||
createdByAddress as created_by_address, | ||
donationsEndTime as donations_end_time, | ||
donationsStartTime as donations_start_time, | ||
lower(id) as id, | ||
isReadyForPayout as is_ready_for_payout, | ||
managerRole as manager_role, | ||
matchAmount as match_amount, | ||
matchAmountInUsd as match_amount_in_usd, | ||
matchTokenAddress as match_token_address, | ||
nodeId as node_id, | ||
lower(projectId) as project_id, | ||
roundMetadata as round_metadata, | ||
roundMetadataCid as round_metadata_cid, | ||
roundMetadata->>'$.name' as round_metadata_name, | ||
roundMetadata->>'$.roundType' as round_metadata_round_type, | ||
lower(roundMetadata->>'$.programContractAddress') as round_metadata_program_address, | ||
roundMetadata->>'$.quadraticFundingConfig.sybilDefense' as round_metadata_sybil_defense, | ||
strategyAddress as strategy_address, | ||
strategyId as strategy_id, | ||
strategyName as strategy_name, | ||
tags, | ||
totalAmountDonatedInUsd as total_amount_donated_in_usd, | ||
totalDonationsCount as total_donations_count, | ||
uniqueDonorsCount as unique_donors_count, | ||
updatedAtBlock as updated_at_block | ||
from source | ||
) | ||
|
||
select * from renamed |
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,21 @@ | ||
with source as ( | ||
select * from {{ source('public', 'raw_allo_subscriptions') }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
chainId as chain_id, | ||
lower(contractAddress) as contract_address, | ||
contractName as contract_name, | ||
createdAt as created_at, | ||
fromBlock as from_block, | ||
id, | ||
indexedToBlock as indexed_to_block, | ||
indexedToLogIndex as indexed_to_log_index, | ||
nodeId as node_id, | ||
toBlock as to_block, | ||
updatedAt as updated_at | ||
from source | ||
) | ||
|
||
select * from renamed |
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 |
---|---|---|
@@ -1,30 +1,36 @@ | ||
with source as ( | ||
select metadata, chainid, roundid, projectid, id from {{ source("public", "raw_round_applications") }} | ||
), | ||
with source as ( | ||
select | ||
metadata, | ||
chainid, | ||
roundid, | ||
projectid, | ||
id | ||
from {{ source("public", "raw_allo_applications") }} | ||
), | ||
|
||
renamed as ( | ||
select | ||
unnest( | ||
from_json(json_extract_path_text(source.metadata, '$.application.answers'), '["json"]') | ||
) as row_json, | ||
chainid as chain_id, | ||
roundid as round_id, | ||
id as application_id, | ||
projectid as project_id | ||
from source | ||
), | ||
renamed as ( | ||
select | ||
unnest( | ||
from_json(json_extract_path_text(source.metadata, '$.application.answers'), '["json"]') | ||
) as row_json, | ||
chainid as chain_id, | ||
roundid as round_id, | ||
id as application_id, | ||
projectid as project_id | ||
from source | ||
), | ||
|
||
extracted as ( | ||
select | ||
json_extract_path_text(row_json, 'questionId') as question_id, | ||
project_id, | ||
application_id, | ||
chain_id, | ||
lower(round_id) as round_id, | ||
json_extract_path_text(row_json, 'question') as question, | ||
json_extract_path_text(row_json, 'type') as question_type, | ||
json_extract_path_text(row_json, 'answer') as answer | ||
from renamed | ||
) | ||
extracted as ( | ||
select | ||
json_extract_path_text(row_json, 'questionId') as question_id, | ||
project_id, | ||
application_id, | ||
chain_id, | ||
lower(round_id) as round_id, | ||
json_extract_path_text(row_json, 'question') as question, | ||
json_extract_path_text(row_json, 'type') as question_type, | ||
json_extract_path_text(row_json, 'answer') as answer | ||
from renamed | ||
) | ||
|
||
select * from extracted where answer is not null -- filters out encrypted and skipped answers |
2 changes: 1 addition & 1 deletion
2
dbt/models/passport_scores.sql → dbt/models/gitcoin_passport_scores.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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.