fleetio / dbt-segment

Data models for Segment built using dbt (getdbt.com).
https://hub.getdbt.com/dbt-labs/segment/latest/
Apache License 2.0
11 stars 7 forks source link

Add Support for Multiple Pageview Sources #11

Closed 0adamjones closed 1 year ago

0adamjones commented 1 year ago

Description & motivation

Before, this package could only sessionize pageview data for a single source. At Fleetio, we have Segment pageview data coming in from multiple sources (right now, our Marketing Site and also our Help Center). In this PR, I'm adding the ability to list multiple pageview sources in the segment_page_views_table variable and adding a source_name column to the downstream models. If the user only has 1 source configured, they won't see any changes other than an additional column on the modeling called source_name. However, if the variable is configured with a list of pageview sources to sessionize, the user will be able to filter the segment_web_page_views and segment_web_sessions models on source_name to see page views and sessions for the specific source they'd like to analyze.

Also, we're upgrading the docker image's postgres version for the integration tests because the CI job kept failing. After doing some research on the error we were getting, we concluded that the issue was the outdated postgres version.

Tested for Snowflake and Postgres, and I don't think I'm using any functions that aren't universally accepted so this shouldn't break Redshift or BigQuery.

For anyone at Fleetio reviewing, here is my QA worksheet to ensure the new model results match the current: Snowflake Worksheet

Checklist