diff --git a/dbt_project.yml b/dbt_project.yml index 876fff1..60b122b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -29,7 +29,7 @@ tests: on-run-start: - "{{ create_sps() }}" - - "{{ create_udfs() }}" + # - "{{ create_udfs() }}" on-run-end: - '{{ apply_meta_as_tags(results) }}' diff --git a/macros/create_udfs.sql b/macros/create_udfs.sql index b7b1358..0923536 100644 --- a/macros/create_udfs.sql +++ b/macros/create_udfs.sql @@ -1,12 +1,8 @@ -{% macro create_udfs() %} - {% if var("UPDATE_UDFS_AND_SPS") %} - {% set sql %} - CREATE schema if NOT EXISTS silver; - {{ create_udf_hex_to_int( - schema = "public" - ) }} - - {% endset %} - {% do run_query(sql) %} - {% endif %} -{% endmacro %} +-- {% macro create_udfs() %} +-- {% if var("UPDATE_UDFS_AND_SPS") %} +-- {% set sql %} +-- CREATE schema if NOT EXISTS silver; +-- {% endset %} +-- {% do run_query(sql) %} +-- {% endif %} +-- {% endmacro %} diff --git a/macros/python/udfs.sql b/macros/python/udfs.sql deleted file mode 100644 index df0489e..0000000 --- a/macros/python/udfs.sql +++ /dev/null @@ -1,21 +0,0 @@ -{% macro create_udf_hex_to_int(schema) %} -create or replace function {{ schema }}.udf_hex_to_int(hex string) -returns string -language python -runtime_version = '3.8' -handler = 'hex_to_int' -as -$$ -def hex_to_int(hex) -> str: - """ - Converts hex (of any size) to int (as a string). Snowflake and java script can only handle up to 64-bit (38 digits of precision) - select hex_to_int('200000000000000000000000000000211'); - >> 680564733841876926926749214863536423441 - select hex_to_int('0x200000000000000000000000000000211'); - >> 680564733841876926926749214863536423441 - select hex_to_int(NULL); - >> NULL - """ - return str(int(hex, 16)) if hex else None -$$; -{% endmacro %} \ No newline at end of file diff --git a/models/doc_descriptions/general/__overview__.md b/models/doc_descriptions/general/__overview__.md index cae4381..54369f2 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/doc_descriptions/general/__overview__.md @@ -3,11 +3,12 @@ # Welcome to the Flipside Crypto External Models Documentation! ## **What does this documentation cover?** -The documentation included here details the design of the External tables and views available via [Flipside Crypto.](https://flipsidecrypto.xyz/earn). For more information on how these models are built, please see [the github repository.](https://github.com/FlipsideCrypto/external-models) +The documentation included here details the design of the External tables and views available via [Flipside Crypto](https://flipsidecrypto.xyz/earn). For more information on how these models are built, please see [the github repository.](https://github.com/FlipsideCrypto/external-models) ### **Quick Links to Table Documentation** -**Token Flow: Ethereum** +**Token Flow: Ethereum** + [Token Flow Documentation](https://docs.tokenflow.live/) - [tokenflow_eth__blocks](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.blocks) @@ -16,11 +17,12 @@ The documentation included here details the design of the External tables and vi - [tokenflow_eth__state_diffs](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.state_diffs) - [tokenflow_eth__storage_diffs](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.storage_diffs) - [tokenflow_eth__storage_reads](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.storage_reads) -- [tokenflow_eth__transactions](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.transactions)

+- [tokenflow_eth__transactions](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.transactions) **Token Flow: Starknet** + [Token Flow Documentation](https://docs.tokenflow.live/) - [tokenflow_starknet__decoded_blocks](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_starknet_decoded.blocks) @@ -46,7 +48,6 @@ The dimension tables are sourced from a variety of on-chain and off-chain source Convenience views (denoted ez_) are a combination of different fact and dimension tables. -A user-defined-function (UDF) is available to decode hex encoded values to integers in this database. You can call this UDF by using `external.public.udf_hex_to_int(FIELD::string)`. ## **Using dbt docs** ### Navigation