diff --git a/analysis/generate_test_udf_skeleton.sql b/analysis/generate_test_udf_skeleton.sql deleted file mode 100644 index 2e59e38..0000000 --- a/analysis/generate_test_udf_skeleton.sql +++ /dev/null @@ -1,45 +0,0 @@ -{% set schema = "strangelove" %} -{% set config = fromyaml(config_strangelove_udfs(schema_name = schema, utils_schema_name = "quicknode_utils")) %} -{% set raw_test_queries %} -strangelove.get: - - | - 'https://api.strange.love/cosmoshub/mainnet/rpc/block_by_hash' - - | - { - 'blockHash': '0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED' - } - - -strangelove.post: - - | - 'https://endpoint' - - | - { - 'foo': 'bar' - } - -{% endset %} -{% set test_queries = fromyaml(raw_test_queries) %} -{{ test_queries }} -{{ schema }} -_____ - columns: -{%- for item in config %} - - name: {{ item["name"] | replace(schema~".", "") }} - tests: - - test_marketplace_udf: - name: test_{{ item["name"].replace(".", "__") ~ "_status_200" }} - args: > - {{ test_queries[item["name"]] | join(", ") | indent(16) }} - validations: - - result:status_code = 200 -{%- endfor %} - -===================== - -{{ config | pprint}} -{# {% for item in config %} -{% if item["return_type"][0] != "VARIANT"%} - {{ item["return_type"][0] }} -{% endif %} -{% endfor %} #} \ No newline at end of file diff --git a/analysis/test_crud_udfs_in_schema.sql b/analysis/test_crud_udfs_in_schema.sql deleted file mode 100644 index 449dabc..0000000 --- a/analysis/test_crud_udfs_in_schema.sql +++ /dev/null @@ -1,3 +0,0 @@ -{{crud_udfs_by_chain(config_evm_high_level_abstractions, 'ethereum', 'mainnet', false)}} -{{- crud_udfs_by_chain(config_evm_rpc_primitives, "ethereum", None, False) -}} -{{- crud_udfs_by_chain(config_evm_rpc_primitives, "ethereum", None, true) -}} \ No newline at end of file diff --git a/dbt_project.yml b/dbt_project.yml index 217b978..f9270c5 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -25,7 +25,7 @@ clean-targets: # directories to be removed by `dbt clean` - "dbt_packages" models: - livequery_models: + livequery_base: deploy: +materialized: ephemeral core: @@ -34,20 +34,13 @@ models: +enabled: '{{ true if env_var("ENABLE_SNOWFLAKE_SECRETS", "") else false }}' evm: +tags: evm - marketplace: - +tags: marketplace + tests: +store_failures: true # all tests - livequery_models: - deploy: - marketplace: - blockpour: - # TODO: enable tests for blockpour once we get an API key - +enabled: false - + seeds: - +enabled: "{{ target.name not in ['livequery', 'livequery_dev'] }}" + +enabled: "{{ target.database not in ['livequery', 'livequery_dev'] }}" on-run-start: - "{{ create_sps() }}" @@ -67,8 +60,8 @@ vars: UPDATE_UDFS_AND_SPS: false DROP_UDFS_AND_SPS: false UPDATE_SNOWFLAKE_TAGS: true - STREAMLINE_INVOKE_STREAMS: False - STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False + STREAMLINE_INVOKE_STREAMS: false + STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: false STUDIO_TEST_USER_ID: '{{ env_var("STUDIO_TEST_USER_ID", "98d15c30-9fa5-43cd-9c69-3d4c0bb269f5") }}' API_INTEGRATION: '{{ var("config")[target.name]["API_INTEGRATION"] }}' diff --git a/macros/livequery/manage_udfs.sql b/macros/livequery/manage_udfs.sql index b5b656f..b3f09fe 100644 --- a/macros/livequery/manage_udfs.sql +++ b/macros/livequery/manage_udfs.sql @@ -117,36 +117,6 @@ {%- endfor -%} {%- endmacro -%} -{% macro crud_udfs_by_marketplace(config_func, schema, utility_schema, drop_) %} -{# - Generate create or drop statements for a list of udf configs for a given blockchain and network - - config_func: function that returns a list of udf configs - schema: schema name - utility_schema: utility schema name - #} - CREATE SCHEMA IF NOT EXISTS {{ schema }}; - {%- set configs = fromyaml(config_func(schema, utility_schema)) if utility_schema else fromyaml(config_func(schema, schema)) -%} - {%- for udf in configs -%} - {{- create_or_drop_function_from_config(udf, drop_=drop_) -}} - {%- endfor -%} -{%- endmacro -%} - -{% macro crud_marketplace_udfs(config_func, schemaName, base_api_schema_name, drop_) %} -{# - Generate create or drop statements for a list of udf configs for a given schema and api - - config_func: function that returns a list of udf configs - schemaName: the target schema to build the udfs - base_api_schema_name: the schema that contains base api functions - drop_: whether to drop or create the udfs - #} - {%- set udfs = fromyaml(config_func(schemaName, base_api_schema_name)) -%} - {%- for udf in udfs -%} - {{- create_or_drop_function_from_config(udf, drop_=drop_) -}} - {%- endfor -%} -{%- endmacro -%} - {% macro ephemeral_deploy_core(config) %} {# This macro is used to deploy functions using ephemeral models. @@ -190,26 +160,4 @@ SELECT '{{ model.schema }}' as schema_ {%- endmacro -%} -{% macro ephemeral_deploy_marketplace(configs) %} -{# - This macro is used to deploy functions using ephemeral models. - It should only be used within an ephemeral model. - #} - {%- set schema = this.schema -%} - {%- set utility_schema = this.identifier -%} - {% if execute and (var("UPDATE_UDFS_AND_SPS") or var("DROP_UDFS_AND_SPS")) and model.unique_id in selected_resources %} - {% set sql %} - {% for config in configs %} - {{- crud_udfs_by_marketplace(config, schema, utility_schema, var("DROP_UDFS_AND_SPS")) -}} - {%- endfor -%} - {%- endset -%} - {%- if var("DROP_UDFS_AND_SPS") -%} - {%- do log("Drop marketplace udfs: " ~ this.database ~ "." ~ schema, true) -%} - {%- else -%} - {%- do log("Deploy marketplace udfs: " ~ this.database ~ "." ~ schema, true) -%} - {%- endif -%} - {%- do run_query(sql ~ apply_grants_by_schema(schema)) -%} - {%- endif -%} - SELECT '{{ model.schema }}' as schema_ -{%- endmacro -%}