diff --git a/dev-requirements.txt b/dev-requirements.txt index 33cf8582..f67bc9be 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ build~=0.1.0 -black~=22.0 +black~=24.3 flake8~=5.0 flake8-bugbear~=22.9 isort~=5.7 diff --git a/storey/drivers.py b/storey/drivers.py index d7829b18..67ae66d7 100644 --- a/storey/drivers.py +++ b/storey/drivers.py @@ -508,9 +508,9 @@ def _build_simplified_feature_store_request(self, aggregation_element): f"{aggregation_value.default_value})" ) if array_time_attribute_name not in times_update_expressions: - times_update_expressions[ - array_time_attribute_name - ] = f"{array_time_attribute_name}={expected_time_expr}" + times_update_expressions[array_time_attribute_name] = ( + f"{array_time_attribute_name}={expected_time_expr}" + ) new_cached_times[name] = ( array_time_attribute_name, expected_time, diff --git a/storey/table.py b/storey/table.py index ee1dac98..a9d4e354 100644 --- a/storey/table.py +++ b/storey/table.py @@ -1462,7 +1462,7 @@ def __init__( self.period_millis = explicit_windows.period_millis self._window_start_time = explicit_windows.get_window_start_time_by_time(base_time) if self._precalculated_aggregations: - for (window_millis, _) in explicit_windows.windows: + for window_millis, _ in explicit_windows.windows: for aggr in self._all_raw_aggregates: self._current_aggregate_values[(aggr, window_millis)] = AggregationValue.new_from_name( aggr, max_value @@ -1673,7 +1673,7 @@ def get_features(self, timestamp): else: # In case our pre aggregates already have the answer for aggregation_name in self._explicit_raw_aggregations: - for (window_millis, window_str) in self.explicit_windows.windows: + for window_millis, window_str in self.explicit_windows.windows: value = self._current_aggregate_values[(aggregation_name, window_millis)].value count_value = self._current_aggregate_values[("count", window_millis)].value if value == math.inf or value == -math.inf: @@ -1691,7 +1691,7 @@ def augment_virtual_features(self, features): args = [None, None, None] # Avoid in-loop allocation for aggregate in self._virtual_aggregations: - for (window_millis, window_str) in self.explicit_windows.windows: + for window_millis, window_str in self.explicit_windows.windows: for i, aggr in enumerate(aggregate.dependant_aggregates): args[i] = self._current_aggregate_values[(aggr, window_millis)].value features[f"{self.name}_{aggregate.name}_{window_str}"] = aggregate.aggregation_func(args) @@ -1710,7 +1710,7 @@ def calculate_features(self, timestamp): for aggregation_name in self._all_raw_aggregates: self._intermediate_aggregation_values[aggregation_name].reset() prev_windows_millis = 0 - for (window_millis, window_string) in self.explicit_windows.windows: + for window_millis, window_string in self.explicit_windows.windows: # In case the current bucket is outside our time range just create a feature with the current aggregated # value if current_time_bucket_index < 0: