Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeee committed Nov 20, 2024
1 parent 4de26c7 commit aa9dc71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildstock_query/query_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 5 additions & 4 deletions tests/test_BuildStockQuery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aa9dc71

Please # to comment.