Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 287a73e

Browse files
committed
Whitespace tidy up
1 parent f7eae48 commit 287a73e

File tree

14 files changed

+38
-41
lines changed

14 files changed

+38
-41
lines changed

.github/issue_template/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ If applicable, add screenshots or log output to help explain your problem.
5555
### Additional context
5656
<!---
5757
Add any other context about the problem here.
58-
--->
58+
--->

analysis/mode_queries/audience_overview.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
-#}
99

1010
with source as (
11-
11+
1212
select * from {{ref('segment_web_sessions')}}
13-
13+
1414
)
1515

1616
, final as (
17-
17+
1818
select
1919
date_trunc({% raw %}'{{date_part}}'{% endraw %}, session_start_tstamp)::date as period,
20-
20+
2121
count(*) as sessions,
2222
count(distinct blended_user_id) as distinct_users,
2323
sum(page_views) as page_views,
@@ -29,12 +29,12 @@ with source as (
2929
sum(case when session_number > 1 then 1 else 0 end) as repeat_sessions
3030

3131
from source
32-
32+
3333
where session_start_tstamp >= '{% raw %}{{start_date}}{% endraw %}'
3434
and session_start_tstamp < '{% raw %}{{end_date}}{% endraw %}'
35-
35+
3636
group by 1
37-
37+
3838
)
3939

4040
select * from final

data/referrer_mapping.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,4 +1802,4 @@ social,Tumblr,t.umblr.com
18021802
search,Sogou,sogou.com
18031803
search,Sogou,m.sogou.com
18041804
social,UISDC,uisdc.com
1805-
social,UISDC,hao.uisdc.com
1805+
social,UISDC,hao.uisdc.com

dbt_project.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'segment'
22
version: '1.0'
33

44
source-paths: ["models"]
5-
analysis-paths: ["analysis"]
5+
analysis-paths: ["analysis"]
66
test-paths: ["tests"]
77
data-paths: ["data"]
88
macro-paths: ["macros"]
@@ -17,18 +17,18 @@ require-dbt-version: ">=0.14.0"
1717
models:
1818
vars:
1919
# location of raw data table
20-
segment_page_views_table:
21-
22-
# number of trailing hours to re-sessionize for.
23-
# events can come in late and we want to still be able to incorporate
20+
segment_page_views_table:
21+
22+
# number of trailing hours to re-sessionize for.
23+
# events can come in late and we want to still be able to incorporate
2424
# them into the definition of a session without needing a full refresh.
25-
segment_sessionization_trailing_window: 3
25+
segment_sessionization_trailing_window: 3
2626

2727
# sessionization inactivity cutoff: of there is a gap in page view times
2828
# that exceeds this number of seconds, the subsequent page view will
2929
# start a new session.
3030
segment_inactivity_cutoff: 30 * 60
31-
31+
3232
# If there are extra columns you wish to pass through this package,
3333
# define them here. Columns will be included in the `segment_web_sessions`
3434
# model as `first_<column>` and `last_<column>`. Extremely useful when
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
id,anonymous_id,user_id,received_at,sent_at,timestamp,url,path,title,search,referrer,context_campaign_source,context_campaign_medium,context_campaign_name,context_campaign_term,context_campaign_content,context_ip,context_user_agent
2-
ajs-9527e97fc714abe02a23b3d24cf09a36,507f191e810c19729de860ea,97980cfea0067,2015-02-23 22:28:55,2015-02-23 22:28:55,2015-02-23 22:28:55,https://www.getdbt.com/,/product,Product,?name=ferret,https://www.google.com/,facebook,social,autumn_collection_2015,foo,bar,8.8.8.8,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"
2+
ajs-9527e97fc714abe02a23b3d24cf09a36,507f191e810c19729de860ea,97980cfea0067,2015-02-23 22:28:55,2015-02-23 22:28:55,2015-02-23 22:28:55,https://www.getdbt.com/,/product,Product,?name=ferret,https://www.google.com/,facebook,social,autumn_collection_2015,foo,bar,8.8.8.8,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"

integration_tests/packages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
packages:
32
- local: ../

models/base/docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
This is a base model for Segment's web page views table. It does some straightforward renaming and parsing of Segment raw data in this table.
66

7-
{% enddocs %}
7+
{% enddocs %}

models/base/schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ models:
77
- name: page_view_id
88
tests:
99
- unique
10-
- not_null
10+
- not_null

models/base/segment_web_page_views.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
with source as (
22

33
select * from {{var('segment_page_views_table')}}
4-
4+
55
),
66

77
renamed as (
88

99
select
10-
10+
1111
id as page_view_id,
1212
anonymous_id,
1313
user_id,
14-
14+
1515
received_at as received_at_tstamp,
1616
sent_at as sent_at_tstamp,
1717
timestamp as tstamp,
@@ -21,7 +21,7 @@ renamed as (
2121
path as page_url_path,
2222
title as page_title,
2323
search as page_url_query,
24-
24+
2525
referrer,
2626
replace(
2727
{{ dbt_utils.get_url_host('referrer') }},
@@ -43,19 +43,19 @@ renamed as (
4343
{{ dbt_utils.split_part(dbt_utils.split_part('context_user_agent', "'('", 2), "' '", 1) }},
4444
';', '')
4545
end as device
46-
46+
4747
{% if var('segment_pass_through_columns') != [] %}
4848
,
4949
{{ var('segment_pass_through_columns') | join (", ")}}
50-
50+
5151
{% endif %}
52-
52+
5353
from source
5454

5555
),
5656

5757
final as (
58-
58+
5959
select
6060
*,
6161
case
@@ -69,4 +69,4 @@ final as (
6969

7070
)
7171

72-
select * from final
72+
select * from final

models/sessionization/docs.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The implementation of this logic is rather involved, and requires multiple CTEs.
2222

2323
{% docs segment_web_sessions__initial %}
2424

25-
This model performs the aggregation of page views into sessions. The `session_id` having already been calculated in `segment_web_page_views__sessionized`, this model simply calls a bunch of window functions to grab the first or last value of a given field and store it at the session level.
25+
This model performs the aggregation of page views into sessions. The `session_id` having already been calculated in `segment_web_page_views__sessionized`, this model simply calls a bunch of window functions to grab the first or last value of a given field and store it at the session level.
2626

2727
{% enddocs %}
2828

@@ -42,12 +42,10 @@ It is recommended to typically run this model in its default configuration (incr
4242

4343
{% docs segment_web_sessions %}
4444

45-
The purpose of this model is to expose a single web session, derived from Segment web events. Sessions are the most common way that analysis of web visitor behavior is conducted, and although Segment doesn't natively output session data, this model uses standard logic to create sessions out of page view events.
45+
The purpose of this model is to expose a single web session, derived from Segment web events. Sessions are the most common way that analysis of web visitor behavior is conducted, and although Segment doesn't natively output session data, this model uses standard logic to create sessions out of page view events.
4646

4747
A session is meant to represent a single instance of web activity where a user is actively browsing a website. In this case, we are demarcating sessions by 30 minute windows of inactivity: if there is 30 minutes of inactivity between two page views, the second page view begins a new session. Additionally, page views across different devices will always be tied to different sessions.
4848

4949
The logic implemented in this particular model is responsible for incrementally calculating a user's session number; the core sessionization logic is done in upstream models.
5050

5151
{% enddocs %}
52-
53-

0 commit comments

Comments
 (0)