Coverage for jstark/features/max_gross_price.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"""MaxGrossPrice feature"""
2import pyspark.sql.functions as f
3from pyspark.sql import Column
5from .max_feature import Max
8class MaxGrossPrice(Max):
9 def column_expression(self) -> Column:
10 return f.col("GrossSpend") / f.col("Quantity")
12 @property
13 def description_subject(self) -> str:
14 return "Maximum of (GrossSpend / Quantity)"
16 @property
17 def commentary(self) -> str:
18 return (
19 "The gross price is calculated as the gross "
20 + "spend divided by how many were bought."
21 )