diff --git a/buildstock_query/query_core.py b/buildstock_query/query_core.py index 50b4063..7791970 100644 --- a/buildstock_query/query_core.py +++ b/buildstock_query/query_core.py @@ -1051,7 +1051,7 @@ def _get_weight(self, weights): total_weight *= self._get_column(weight_col) return total_weight - def _get_agg_func_and_weight(self, weights, agg_func = None): + def _get_agg_func_and_weight(self, weights, agg_func=None): if agg_func is None or agg_func == 'sum': return safunc.sum, self._get_weight(weights) if callable(agg_func): diff --git a/tests/test_BuildStockQuery.py b/tests/test_BuildStockQuery.py index 299e7c4..3c99f82 100644 --- a/tests/test_BuildStockQuery.py +++ b/tests/test_BuildStockQuery.py @@ -461,14 +461,15 @@ def test_aggregate_ts(temp_history_file): get_query_only=True) assert_query_equal(query9, valid_query_string9) # Test that the agg_func is applied correctly + def min_func(col): return safunc.min(col) query10 = my_athena2.agg.aggregate_timeseries(enduses=enduses, - collapse_ts=False, - agg_func=min_func, - timestamp_grouping_func='month', - get_query_only=True) + collapse_ts=False, + agg_func=min_func, + timestamp_grouping_func='month', + get_query_only=True) valid_query_string10 = """ select date_trunc('month', res_n250_hrly_v1_timeseries.time) AS time, count(distinct(res_n250_hrly_v1_timeseries.building_id)) AS sample_count,