Coverage for jstark / features / customer_count.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-23 22:34 +0000

1"""CustomerCount feature""" 

2 

3import pyspark.sql.functions as f 

4from pyspark.sql import Column 

5 

6from jstark.features.distinctcount_feature import DistinctCount 

7 

8 

9class CustomerCount(DistinctCount): 

10 def column_expression(self) -> Column: 

11 return f.col("Customer") 

12 

13 @property 

14 def description_subject(self) -> str: 

15 return "Distinct count of Customers" 

16 

17 @property 

18 def commentary(self) -> str: 

19 return ( 

20 "The number of customers. Typically the dataframe supplied " 

21 + "to this feature will have many transactions for many baskets each bought" 

22 + " a different customer, this feature allows you to determine how many " 

23 + "disinct customerss bought those baskets." 

24 )