This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set relations = dbt_utils.get_relations_by_prefix('<<YOUR_DATASET_NAME>>', '') %} | |
with base as ( | |
{% for relation in relations %} | |
(select | |
"{{ relation.identifier }}" as table, | |
array_to_string(array(select col from unnest(bigfunctions.eu.json_keys(_airbyte_data)) as col order by col), ',') as columns, | |
min(_airbyte_extracted_at) as min_date, | |
max(_airbyte_extracted_at) as max_date, | |
from airbyte_internal.<<YOUR_DATASET_NAME>>_raw__stream_{{ relation.identifier }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION `<project-id>.<dataset-id>.roc_auc`(scores ARRAY<FLOAT64>, labels ARRAY<BOOL>) | |
RETURNS FLOAT64 AS ( | |
( | |
with input_data as ( | |
select scores.score, labels.label | |
from( | |
SELECT *, row_number() over () as row_num | |
FROM UNNEST(scores) as score) scores | |
join( | |
SELECT *, row_number() over () as row_num |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
METABASE_URL = '<YOUR_METABASE_URL>' | |
METABASE_USERNAME = '<YOUR_METABASE_USERNAME>' | |
METABASE_PASSWORD = '<YOUR_METABASE_PASSWORD>' | |
PREFIX = "-- METABASE_QUESTION_ID = " | |
SUFFIX = " - DO NOT CHANGE THIS LINE\n" | |
def login(): |