LiveQuery DeFiLLama Api key integration, workflow updates for Warehouse (#61)

This commit is contained in:
Julius Remigio 2023-10-24 11:09:04 -07:00 committed by GitHub
parent 31d5084cff
commit 64c644178a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 21 deletions

View File

@ -20,6 +20,7 @@ on:
options:
- DBT
- DBT_CLOUD
- XSMALL
default: DBT
schedule:
# Runs “Daily at midnight GMT” (see https://crontab.guru)
@ -34,7 +35,7 @@ jobs:
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
with:
warehouse: DBT_CLOUD
warehouse: ${{ vars.WAREHOUSE }}
environment: hosted
command: test -s test___utils_udf_introspect
@ -43,7 +44,7 @@ jobs:
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
with:
warehouse: DBT_CLOUD
warehouse: ${{ vars.WAREHOUSE }}
environment: prod
command: test -s test___utils_udf_introspect

View File

@ -11,6 +11,7 @@ on:
options:
- dev
- prod
- hosted
default: dev
warehouse:
type: choice
@ -19,6 +20,7 @@ on:
options:
- DBT
- DBT_CLOUD
- XSMALL
default: DBT
schedule:
# Runs “Daily at midnight GMT” (see https://crontab.guru)
@ -33,7 +35,7 @@ jobs:
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
with:
warehouse: DBT_CLOUD
warehouse: ${{ vars.WAREHOUSE }}
environment: prod
command: test --selector test_udfs --threads 24

View File

@ -17,24 +17,8 @@
'GET',
concat('https://api.llama.fi', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
{'Accept': '*/*', 'User-Agent': 'livequery/1.0 (Snowflake)', 'Host':'api.llama.fi', 'Connection': 'keep-alive'},
{}
) as response
- name: {{ schema_name -}}.post
signature:
- [PATH, STRING, The path starting with '/']
- [BODY, OBJECT, The request body]
return_type:
- "VARIANT"
options: |
COMMENT = $$Used to issue a 'POST' request to the Defillama API. [Defillama docs here](https://defillama.com/docs/api).$$
sql: |
SELECT
live.udf_api(
'POST',
CONCAT('https://api.llama.fi', PATH),
{'Accept': '*/*', 'User-Agent': 'livequery/1.0 (Snowflake)', 'Host':'api.llama.fi', 'Connection': 'keep-alive'},
BODY
{},
IFF(ARRAY_CONTAINS('api_key'::VARIANT, OBJECT_KEYS(QUERY_ARGS)), '_FSC_SYS/DEFILLAMA', '')
) as response
{% endmacro %}