Get previous multivariate values from history.
(
feature_state: FeatureState,
)
| 144 | |
| 145 | |
| 146 | def _get_previous_multivariate_values( |
| 147 | feature_state: FeatureState, |
| 148 | ) -> list[MultivariateFeatureStateValue]: |
| 149 | """Get previous multivariate values from history.""" |
| 150 | mv_values: list[MultivariateFeatureStateValue] = [] |
| 151 | for mv in MultivariateFeatureStateValue.objects.filter( |
| 152 | feature_state_id=feature_state.id |
| 153 | ).select_related("multivariate_feature_option"): |
| 154 | history = mv.history.first() |
| 155 | if history and history.prev_record: |
| 156 | mv_values.append(history.prev_record.instance) |
| 157 | return mv_values |
| 158 | |
| 159 | |
| 160 | @register_task_handler() |
no test coverage detected
searching dependent graphs…