From 369d9d63b13a7159919c3c5e313b206fac556e04 Mon Sep 17 00:00:00 2001 From: Carl Cervone <42869436+ccerv1@users.noreply.github.com> Date: Mon, 7 Oct 2024 05:52:45 -0400 Subject: [PATCH] feat(dbt): add EAS source and staging model (#2322) --- .../ethereum_attestation_service_sources.yml | 7 +++++++ ...ethereum_attestation_service__optimism.sql | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 warehouse/dbt/models/ethereum_attestation_service_sources.yml create mode 100644 warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql diff --git a/warehouse/dbt/models/ethereum_attestation_service_sources.yml b/warehouse/dbt/models/ethereum_attestation_service_sources.yml new file mode 100644 index 000000000..e0af75b63 --- /dev/null +++ b/warehouse/dbt/models/ethereum_attestation_service_sources.yml @@ -0,0 +1,7 @@ +sources: + - name: ethereum_attestation_service_optimism + database: opensource-observer + schema: ethereum_attestation_service_optimism + tables: + - name: attestations + identifier: attestations diff --git a/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql b/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql new file mode 100644 index 000000000..4ab767850 --- /dev/null +++ b/warehouse/dbt/models/staging/ethereum_attestation_service/stg_ethereum_attestation_service__optimism.sql @@ -0,0 +1,19 @@ +select + id, + attester, + recipient, + ref_uid, + schema_id, + decoded_data_json, + revocable, + revoked, + is_offchain, + txid as transaction_hash, + timestamp_seconds(`time`) as `time`, + case + when expiration_time != 0 then timestamp_seconds(expiration_time) + end as expiration_time, + case + when revocation_time != 0 then timestamp_seconds(revocation_time) + end as revocation_time +from {{ source("ethereum_attestation_service_optimism", "attestations") }}