Coverage for jstark / mealkit / allergen_count.py: 100%
12 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-04-30 09:29 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-04-30 09:29 +0000
1"""AllergenCount feature"""
3import pyspark.sql.functions as f
4from pyspark.sql import Column
6from jstark.features.distinctcount_feature import DistinctCount
9class AllergenCount(DistinctCount):
10 def column_expression(self) -> Column:
11 return f.col("Allergen")
13 @property
14 def description_subject(self) -> str:
15 return "Distinct count of Allergens"
17 @property
18 def commentary(self) -> str:
19 return (
20 "The number of allergens. Typically the dataframe supplied "
21 + "to this feature will have many recipes for the same allergen, "
22 + "this feature allows you to determine how many distinct allergens "
23 + "have been ordered."
24 )