From a5ebc82035f512d9d19ca80338c04f3dc9eb3c4c Mon Sep 17 00:00:00 2001 From: Jack Forgash <58153492+forgxyz@users.noreply.github.com> Date: Mon, 3 Oct 2022 22:24:36 -0500 Subject: [PATCH] bespoke tests (#70) --- tests/tests__moment_metadata_allday.sql | 16 ++++++++++++++++ tests/tests__moment_metadata_topshot.sql | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/tests__moment_metadata_allday.sql create mode 100644 tests/tests__moment_metadata_topshot.sql diff --git a/tests/tests__moment_metadata_allday.sql b/tests/tests__moment_metadata_allday.sql new file mode 100644 index 0000000..dc0ca70 --- /dev/null +++ b/tests/tests__moment_metadata_allday.sql @@ -0,0 +1,16 @@ +WITH moments AS ( + SELECT + nft_collection, + nft_id, + _inserted_timestamp + FROM + {{ ref('silver__nft_allday_metadata') }} + WHERE + _inserted_timestamp :: DATE >= CURRENT_DATE - 1 +) +SELECT + IFF(COUNT(nft_id) > 0, TRUE, FALSE) AS recent +FROM + moments +HAVING + recent = FALSE diff --git a/tests/tests__moment_metadata_topshot.sql b/tests/tests__moment_metadata_topshot.sql new file mode 100644 index 0000000..d1589fe --- /dev/null +++ b/tests/tests__moment_metadata_topshot.sql @@ -0,0 +1,16 @@ +WITH moments AS ( + SELECT + nft_collection, + nft_id, + _inserted_timestamp + FROM + {{ ref('silver__nft_topshot_metadata') }} + WHERE + _inserted_timestamp :: DATE >= CURRENT_DATE - 1 +) +SELECT + IFF(COUNT(nft_id) > 0, TRUE, FALSE) AS recent +FROM + moments +HAVING + recent = FALSE