Skip to content

Commit

Permalink
Add v1 compatibility and deprecation notice (#89)
Browse files Browse the repository at this point in the history
* Add v1 compatibility and deprecation notice

* Temporarily allow release candidate for testing

* Update packages.yml
  • Loading branch information
joellabes authored Dec 6, 2022
1 parent 45a6602 commit ef1fed0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> ⛔🏚️ This package is no longer developed or maintained by dbt Labs. If you're interested in forking/adopting it, reach out in #package-ecosystem on dbt Slack.
# dbt-segment
This [dbt package](https://docs.getdbt.com/docs/package-management):
* Performs "user stitching" to tie all events associated with a cookie to the same user_id
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'segment'
version: '0.7.0'
require-dbt-version: [">=1.0.0", "<2.0.0"]
require-dbt-version: [">=1.3.0", "<2.0.0"]
config-version: 2

model-paths: ["models"]
Expand Down
4 changes: 2 additions & 2 deletions macros/generate_sessionization_incremental_filter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% macro default__generate_sessionization_incremental_filter(merge_target, filter_tstamp, max_tstamp, operator) %}
where {{ filter_tstamp }} {{ operator }} (
select
{{ dbt_utils.dateadd(
{{ dbt.dateadd(
'hour',
-var('segment_sessionization_trailing_window'),
'max(' ~ max_tstamp ~ ')'
Expand All @@ -29,7 +29,7 @@
{% macro postgres__generate_sessionization_incremental_filter(merge_target, filter_tstamp, max_tstamp, operator) %}
where cast({{ filter_tstamp }} as timestamp) {{ operator }} (
select
{{ dbt_utils.dateadd(
{{ dbt.dateadd(
'hour',
-var('segment_sessionization_trailing_window'),
'max(' ~ max_tstamp ~ ')'
Expand Down
2 changes: 1 addition & 1 deletion models/base/segment_web_page_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ renamed as (
case
when lower(context_user_agent) like '%android%' then 'Android'
else replace(
{{ dbt_utils.split_part(dbt_utils.split_part('context_user_agent', "'('", 2), "' '", 1) }},
{{ dbt.split_part(dbt.split_part('context_user_agent', "'('", 2), "' '", 1) }},
';', '')
end as device

Expand Down
4 changes: 2 additions & 2 deletions models/sessionization/segment_web_page_views__sessionized.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ diffed as (

select
*,
{{ dbt_utils.datediff('previous_tstamp', 'tstamp', 'second') }} as period_of_inactivity
{{ dbt.datediff('previous_tstamp', 'tstamp', 'second') }} as period_of_inactivity
from lagged

),
Expand Down Expand Up @@ -127,7 +127,7 @@ session_ids as (

{{dbt_utils.star(ref('segment_web_page_views'))}},
page_view_number,
{{dbt_utils.surrogate_key(['anonymous_id', 'session_number'])}} as session_id
{{dbt_utils.generate_surrogate_key(['anonymous_id', 'session_number'])}} as session_id

from session_numbers

Expand Down
2 changes: 1 addition & 1 deletion models/sessionization/segment_web_sessions__initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ diffs as (

*,

{{ dbt_utils.datediff('session_start_tstamp', 'session_end_tstamp', 'second') }} as duration_in_s
{{ dbt.datediff('session_start_tstamp', 'session_end_tstamp', 'second') }} as duration_in_s

from agg

Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- package: dbt-labs/dbt_utils
version: [">=0.8.0", "<0.9.0"]
version: [">=1.0.0", "<2.0.0"]

0 comments on commit ef1fed0

Please sign in to comment.