process_fivetran_shopify_unique_orders#

pymc_marketing.data.fivetran.process_fivetran_shopify_unique_orders(df, *, date_col='processed_timestamp', order_key_col='orders_unique_key', rename_date_to='date')[source]#

Compute daily unique order counts from a (pre-filtered) Shopify dataset.

This function targets data following the Fivetran Shopify orders schema (e.g., shopify__orders). It assumes the input df is already filtered to the desired subset (e.g., non-canceled, US-delivery, new-only orders).

Supports pandas DataFrames, polars DataFrames (eager and lazy), and PySpark DataFrames. The output type matches the input type.

Parameters:
  • df (IntoFrameT) – Input dataframe following the Shopify orders schema. Supported types: pandas.DataFrame, polars.DataFrame, polars.LazyFrame, pyspark.sql.DataFrame

  • date_col (str) – Timestamp column from which the daily bucket is derived.

  • order_key_col (str) – Unique order identifier column.

  • rename_date_to (str) – Name of the date column in the result.

Return type:

IntoFrameT

Returns:

A dataframe with two columns: rename_date_to and orders, where orders is the unique order count per day. The output type matches the input type.