From 31545aef7d5f0a3033c8295ef873ee36dda31f6a Mon Sep 17 00:00:00 2001 From: Jensen Yap Date: Tue, 12 Aug 2025 18:01:30 +0900 Subject: [PATCH] fix test --- macros/marketplace/github/utils_udfs.yaml.sql | 15 ++++++++----- models/deploy/core/live.yml | 22 +++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/macros/marketplace/github/utils_udfs.yaml.sql b/macros/marketplace/github/utils_udfs.yaml.sql index b56cb53..8415c67 100644 --- a/macros/marketplace/github/utils_udfs.yaml.sql +++ b/macros/marketplace/github/utils_udfs.yaml.sql @@ -16,9 +16,10 @@ live.udf_api_v2( 'GET', 'https://api.github.com/octocat', - {'Authorization': 'Bearer {TOKEN}', 'X-GitHub-Api-Version': '2022-11-28', 'fsc-quantum-execution-mode': 'async'}, + {'Authorization': 'Bearer {TOKEN}', 'X-GitHub-Api-Version': '2022-11-28'}, {}, - IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api') + IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api'), + TRUE ) {%- else -%} live.udf_api( @@ -43,7 +44,6 @@ SELECT '{"Authorization": "Bearer {TOKEN}", "X-GitHub-Api-Version": "2022-11-28", "Accept": "application/vnd.github+json", - "fsc-quantum-execution-mode": "async" }' - name: {{ schema_name -}}.get_api @@ -63,7 +63,8 @@ CONCAT_WS('/', 'https://api.github.com', route || '?') || utils.udf_urlencode(query), PARSE_JSON({{ schema_name -}}.headers()), {}, - IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api') + IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api'), + TRUE ) {%- else -%} live.udf_api( @@ -92,7 +93,8 @@ CONCAT_WS('/', 'https://api.github.com', route), PARSE_JSON({{ schema_name -}}.headers()), data, - IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api') + IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api'), + TRUE ) {%- else -%} live.udf_api( @@ -121,7 +123,8 @@ CONCAT_WS('/', 'https://api.github.com', route), PARSE_JSON({{ schema_name -}}.headers()), data, - IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api') + IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'Vault/github/api'), + TRUE ) {%- else -%} live.udf_api( diff --git a/models/deploy/core/live.yml b/models/deploy/core/live.yml index 0a3f0bc..c8fce38 100644 --- a/models/deploy/core/live.yml +++ b/models/deploy/core/live.yml @@ -231,7 +231,7 @@ models: - test_udf: name: test__live_udf_api_v2_get_with_params_sync args: | - 'GET', 'https://httpbin.org/get', {'Content-Type': 'application/json'}, {'param1': 'value1', 'param2': 'value2'}, '' + 'GET', 'https://httpbin.org/get', {'Content-Type': 'application/json'}, {'param1': 'value1', 'param2': 'value2'}, FALSE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data.args is not null ELSE true END @@ -248,7 +248,7 @@ models: 'id': 1, 'method': 'getVersion' }, - '' + FALSE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data.jsonrpc = '2.0' ELSE true END @@ -264,7 +264,7 @@ models: {'jsonrpc': '2.0', 'id': 1, 'method': 'getVersion'}, {'jsonrpc': '2.0', 'id': 2, 'method': 'getVersion'} ], - '' + FALSE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data[0]:jsonrpc = '2.0' ELSE true END @@ -283,7 +283,7 @@ models: {'jsonrpc': '2.0', 'id': 1, 'method': 'eth_blockNumber', 'params': []}, {'jsonrpc': '2.0', 'id': 2, 'method': 'eth_chainId', 'params': []} ], - '' + FALSE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data[0]:jsonrpc = '2.0' ELSE true END @@ -297,7 +297,7 @@ models: - test_udf: name: test__live_udf_api_v2_get_with_params_async args: | - 'GET', 'https://httpbin.org/get', {'Content-Type': 'application/json', 'fsc-quantum-execution-mode': 'async'}, {'param1': 'value1', 'param2': 'value2'}, '' + 'GET', 'https://httpbin.org/get', {'Content-Type': 'application/json'}, {'param1': 'value1', 'param2': 'value2'}, TRUE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data.args is not null ELSE true END @@ -308,13 +308,13 @@ models: args: | 'POST', 'https://api.mainnet-beta.solana.com', - {'Content-Type': 'application/json', 'fsc-quantum-execution-mode': 'async'}, + {'Content-Type': 'application/json'}, { 'jsonrpc': '2.0', 'id': 1, 'method': 'getVersion' }, - '' + TRUE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data.jsonrpc = '2.0' ELSE true END @@ -325,12 +325,12 @@ models: args: | 'POST', 'https://api.mainnet-beta.solana.com', - {'Content-Type': 'application/json', 'fsc-quantum-execution-mode': 'async'}, + {'Content-Type': 'application/json'}, [ {'jsonrpc': '2.0', 'id': 1, 'method': 'getVersion'}, {'jsonrpc': '2.0', 'id': 2, 'method': 'getVersion'} ], - '' + TRUE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data[0]:jsonrpc = '2.0' ELSE true END @@ -344,12 +344,12 @@ models: args: | 'POST', 'https://ethereum-rpc.publicnode.com', - {'Content-Type': 'application/json', 'fsc-quantum-execution-mode': 'async'}, + {'Content-Type': 'application/json'}, [ {'jsonrpc': '2.0', 'id': 1, 'method': 'eth_blockNumber', 'params': []}, {'jsonrpc': '2.0', 'id': 2, 'method': 'eth_chainId', 'params': []} ], - '' + TRUE assertions: - result:status_code IN (200, 502, 503) - CASE WHEN result:status_code = 200 THEN result:data[0]:jsonrpc = '2.0' ELSE true END