diff --git a/README.md b/README.md index 85877f6..c5a8a2d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ _Transforms any time series model with a user ID and event labels into a standar ```sql {{ dbt_product_analytics.event_stream( - from="orders", + from=ref('orders'), event_type_col="status", user_id_col="customer_id", date_col="order_date", @@ -44,7 +44,7 @@ _Runs a funnel analysis, i.e. tells you how many users performed step 1 followed ```sql {% set events = dbt_product_analytics.event_stream( - from="orders", + from=ref('orders'), event_type_col="status", user_id_col="customer_id", date_col="order_date", diff --git a/integration_tests/models/product_analytics/funnel_orders.sql b/integration_tests/models/product_analytics/funnel_orders.sql index 43dbc26..17e9cc0 100644 --- a/integration_tests/models/product_analytics/funnel_orders.sql +++ b/integration_tests/models/product_analytics/funnel_orders.sql @@ -1,6 +1,6 @@ {% set events = dbt_product_analytics.event_stream( - from="orders", + from=ref('orders'), event_type_col="status", user_id_col="customer_id", date_col="order_date", diff --git a/integration_tests/models/product_analytics/order_events.sql b/integration_tests/models/product_analytics/order_events.sql index 7d6a9c8..bde371b 100644 --- a/integration_tests/models/product_analytics/order_events.sql +++ b/integration_tests/models/product_analytics/order_events.sql @@ -1,5 +1,5 @@ {{ dbt_product_analytics.event_stream( - from="orders", + from=ref('orders'), event_type_col="status", user_id_col="customer_id", date_col="order_date", diff --git a/macros/event_stream.sql b/macros/event_stream.sql index ce5112d..cbd3444 100644 --- a/macros/event_stream.sql +++ b/macros/event_stream.sql @@ -7,7 +7,7 @@ end_date=none) %} select {{ event_type_col }} as event_type, {{ user_id_col }} as user_id, {{ date_col }} as event_date - from {{ ref(from) }} + from {{ from }} where 1 = 1 {% if start_date is not none %} and {{ date_col }} >= '{{ start_date }}'