mirror of
https://github.com/FlipsideCrypto/livequery-models.git
synced 2026-02-06 10:56:46 +00:00
LiveQuery DeFiLLama Api key integration, workflow updates for Warehouse (#61)
This commit is contained in:
parent
31d5084cff
commit
64c644178a
5
.github/workflows/dbt_integration_test.yml
vendored
5
.github/workflows/dbt_integration_test.yml
vendored
@ -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
|
||||
|
||||
|
||||
4
.github/workflows/dbt_udf_test.yml
vendored
4
.github/workflows/dbt_udf_test.yml
vendored
@ -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
|
||||
|
||||
|
||||
@ -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 %}
|
||||
Loading…
Reference in New Issue
Block a user