Coverage for jstark/features/store_count.py: 100%
12 statements
« prev ^ index » next coverage.py v7.4.3, created at 2024-02-25 20:09 +0000
« prev ^ index » next coverage.py v7.4.3, created at 2024-02-25 20:09 +0000
1"""StoreCount feature"""
2import pyspark.sql.functions as f
3from pyspark.sql import Column
5from .distinctcount_feature import DistinctCount
8class StoreCount(DistinctCount):
9 def column_expression(self) -> Column:
10 return f.col("Store")
12 @property
13 def description_subject(self) -> str:
14 return "Distinct count of Stores"
16 @property
17 def commentary(self) -> str:
18 return (
19 "The number of stores. Typically the dataframe supplied "
20 + "to this feature will have many transactions for many baskets for "
21 + "many stores, this feature allows you to determine how many "
22 + "stores those baskets were purchased in."
23 )