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:
dfIntoFrameT

Input dataframe following the Shopify orders schema. Supported types: pandas.DataFrame, polars.DataFrame, polars.LazyFrame, pyspark.sql.DataFrame

date_colstr, default “processed_timestamp”

Timestamp column from which the daily bucket is derived.

order_key_colstr, default “orders_unique_key”

Unique order identifier column.

rename_date_tostr, default “date”

Name of the date column in the result.

Returns:
IntoFrameT

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.