diff --git a/.github/workflows/dbt_integration_test.yml b/.github/workflows/dbt_integration_test.yml index a0b1360..c1c834b 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -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 diff --git a/.github/workflows/dbt_udf_test.yml b/.github/workflows/dbt_udf_test.yml index 57e08a8..238b486 100644 --- a/.github/workflows/dbt_udf_test.yml +++ b/.github/workflows/dbt_udf_test.yml @@ -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 diff --git a/macros/marketplace/defillama/udfs.yaml.sql b/macros/marketplace/defillama/udfs.yaml.sql index b0fced4..8f1edd9 100644 --- a/macros/marketplace/defillama/udfs.yaml.sql +++ b/macros/marketplace/defillama/udfs.yaml.sql @@ -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 %} \ No newline at end of file