Skip to content

Commit

Permalink
Update license
Browse files Browse the repository at this point in the history
  • Loading branch information
emielver committed Aug 29, 2023
1 parent c2ee334 commit 95329cf
Show file tree
Hide file tree
Showing 119 changed files with 931 additions and 258 deletions.
252 changes: 51 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions integration_tests/macros/test_get_sde_or_context.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{% macro test_get_sde_or_context() %}

{{ return(adapter.dispatch('test_get_sde_or_context', 'snowplow_utils_integration_tests')()) }}
Expand Down
11 changes: 9 additions & 2 deletions integration_tests/macros/test_get_successful_models.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{# get_successful_models() macro requires the run_results object. This is only generated at the end of the run.
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{# get_successful_models() macro requires the run_results object. This is only generated at the end of the run.
This macro is intended to be run on a 'on-run-end' hook, so the run_results object is present.
It is possible to hardcode a run_results object, however the schema for this object can evolve with time.
By letting dbt generate the object, we ensure we are testing against the correct schema.
#}

{% macro test_get_successful_models(enabled) -%}

{% if enabled and execute %}
{% set actual_successful_models = snowplow_utils.get_successful_models(models=['successful_model_1', 'fail_model', 'skip_model']) %}
{% set expected_successful_models = ['successful_model_1'] %}
Expand Down
7 changes: 7 additions & 0 deletions integration_tests/macros/test_return_limits_from_models.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{% macro test_return_limits_from_models() %}
{{ return(adapter.dispatch('test_return_limits_from_models', 'snowplow_utils')()) }}
{% endmacro %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags=['base_macro']
Expand Down
7 changes: 7 additions & 0 deletions integration_tests/models/base/test.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(
tags='snowplow_incremental'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

select

select
model,
expected_last_success as last_success

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}


{%- set all_models = snowplow_utils.get_incremental_manifest_status(ref('data_get_incremental_manifest_status'), ['a','b','c']) -%}
{%- set partial_models = snowplow_utils.get_incremental_manifest_status(ref('data_get_incremental_manifest_status'), ['b','d']) -%}
Expand Down
19 changes: 12 additions & 7 deletions integration_tests/models/incremental_hooks/test_get_run_limits.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{%- set data_query -%}
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{%- set data_query -%}
select * from {{ ref('data_get_run_limits') }}
{%- endset -%}

Expand All @@ -12,12 +19,12 @@
{% endfor %}

{% for i in range(test_data.min_last_success|length) %}

{# iteratively pass each row of test data into get_run_limits() and execute returned query #}
{%- set results = run_query(snowplow_utils.get_run_limits(test_data.min_last_success[i],
test_data.max_last_success[i],
test_data.models_matched_from_manifest[i],
test_data.has_matched_all_models[i],
test_data.max_last_success[i],
test_data.models_matched_from_manifest[i],
test_data.has_matched_all_models[i],
test_data.start_date[i])) -%}

{# expected limits taken from test data #}
Expand All @@ -42,5 +49,3 @@
{% if not loop.last %} union all {% endif %}

{% endfor %}


Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(tags=["requires_script"])
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(tags=["requires_script"])
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{{
config(tags=["requires_script"])
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(tags=["requires_script"])
}}

select 1 as id
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{{
config(tags=["requires_script"])
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{
config(tags=["requires_script"])
}}

select 1 as id
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{{ config(post_hook="{{ snowplow_utils.update_incremental_manifest_table(this,
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{{ config(post_hook="{{ snowplow_utils.update_incremental_manifest_table(this,
ref('data_update_incremental_manifest_table'),
['a','b','c']) }}",
materialized="table"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{# Tests both RS/PG (delete/insert) and BQ/Snowflake/Databricks (merge) incremental materialization
upsert_date_key: RS/PG/Databricks only. Key used to limit the table scan
partition_by: BQ only. Key used to limit table scan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{# Tests both RS/PG (delete/insert) and BQ/Snowflake/Databricks (merge)
incremental materialization with lookback disabled.
upsert_date_key: RS/PG/Databricks only. Key used to limit the table scan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{# Tests both RS, PG (delete/insert) and BQ/Snowflake (merge) incremental materialization
upsert_date_key: RS, PG only. Key used to limit the table scan
partition_by: BQ only. Key used to limit table scan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

{# Tests both RS, PG (delete/insert) and BQ/Snowflake (merge) incremental materialization with lookback disabled.
upsert_date_key: RS, PG only. Key used to limit the table scan
partition_by: BQ only. Key used to limit table scan #}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
-- Breaking convention and using a model to seed data rather than csv.
{#
Copyright (c) 2021-present Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Snowplow Community License Version 1.0,
and you may not use this file except in compliance with the Snowplow Community License Version 1.0.
You may obtain a copy of the Snowplow Community License Version 1.0 at https://docs.snowplow.io/community-license-1.0
#}

-- Breaking convention and using a model to seed data rather than csv.
-- Easier to construct RECORDs in sql than string in csv.
-- BQ Only
-- BQ Only

with data as (
select
Expand Down
Loading

0 comments on commit 95329cf

Please sign in to comment.