From 6b6556a108d43feea6dbd128fd3a1b4aab587dd7 Mon Sep 17 00:00:00 2001 From: drethereum <71602799+drethereum@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:17:03 -0600 Subject: [PATCH] AN-5113/warpcast-power-users (#79) --- .../doc_descriptions/general/__overview__.md | 2 ++ .../farcaster__fact_warpcast_power_users.sql | 21 +++++++++++++++++++ .../farcaster__fact_warpcast_power_users.yml | 16 ++++++++++++++ models/sources.yml | 3 ++- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 models/farcaster/gold/farcaster__fact_warpcast_power_users.sql create mode 100644 models/farcaster/gold/farcaster__fact_warpcast_power_users.yml diff --git a/models/doc_descriptions/general/__overview__.md b/models/doc_descriptions/general/__overview__.md index c9fdf44..090d73b 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/doc_descriptions/general/__overview__.md @@ -89,6 +89,7 @@ Note: These tables ceased updating on Feburary 4th, 2024. **Farcaster (Neynar)** - [dim_fids](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fids) - [dim_fnames](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fnames) +- [dim_profile_with_addresses](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_profile_with_addresses) - [fact_casts](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_casts) - [fact_links](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_links) - [fact_reactions](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_reactions) @@ -96,6 +97,7 @@ Note: These tables ceased updating on Feburary 4th, 2024. - [fact_storage](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_storage) - [fact_user_data](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_user_data) - [fact_verifications](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_verifications) +- [fact_warpcast_power_users](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_warpcast_power_users) ## **Helpful User-Defined Functions (UDFs)** diff --git a/models/farcaster/gold/farcaster__fact_warpcast_power_users.sql b/models/farcaster/gold/farcaster__fact_warpcast_power_users.sql new file mode 100644 index 0000000..24df08d --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_warpcast_power_users.sql @@ -0,0 +1,21 @@ +{{ config( + materialized = 'view', + persist_docs ={ "relation": true, + "columns": true }, + tags = ['farcaster'], + meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'FARCASTER' } } } +) }} + +SELECT + fid, + created_at, + updated_at, + deleted_at +FROM + {{ source( + 'external_bronze', + 'farcaster_warpcast_power_users' + ) }} + qualify(ROW_NUMBER() over (PARTITION BY fid +ORDER BY + updated_at DESC)) = 1 diff --git a/models/farcaster/gold/farcaster__fact_warpcast_power_users.yml b/models/farcaster/gold/farcaster__fact_warpcast_power_users.yml new file mode 100644 index 0000000..b407016 --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_warpcast_power_users.yml @@ -0,0 +1,16 @@ +version: 2 +models: + - name: farcaster__fact_warpcast_power_users + description: Represents data associated with power users, based on Warpcast power badges. For more info see [Neynar](https://docs.neynar.com/docs/how-to-query-neynar-sql-playground-for-farcaster-data) or [schema](https://github.com/farcasterxyz/hub-monorepo/tree/51c57245df8ec1c68d616dd3ab8ae5b80edf68fd/apps/replicator) + + columns: + - name: FID + description: FID of the user that signed the message. + - name: CREATED_AT + description: When the row was first created in this DB (not the same as the message timestamp!) + - name: UPDATED_AT + description: When the row was last updated. + tests: + - not_null + - name: DELETED_AT + description: When the data was considered deleted by the hub \ No newline at end of file diff --git a/models/sources.yml b/models/sources.yml index 5404fdc..6f5c55d 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -84,4 +84,5 @@ sources: - name: farcaster_reactions - name: farcaster_user_data - name: farcaster_verifications - - name: farcaster_profile_with_addresses \ No newline at end of file + - name: farcaster_profile_with_addresses + - name: farcaster_warpcast_power_users \ No newline at end of file