Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Add service_id to datasets of type latest_dataset_value
Browse files Browse the repository at this point in the history
The import_dashboards.py script in Stagecraft (used for
importing Transactions Explorer data) expects to
find a service_id key in the service aggregates dataset.
This key was missed when this transform was produced and
is causing import_dashboards.py to fail.
  • Loading branch information
leenagupte committed Dec 11, 2015
1 parent 9b86a49 commit 20389b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions backdrop/transformers/tasks/latest_dataset_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def compute(new_data, transform, data_set_config):
'dashboard_slug': slug,
data_type: latest_datum[value_key],
'_timestamp': latest_datum['_timestamp'],
'service_id': slug
})

return latest_values
2 changes: 2 additions & 0 deletions tests/transformers/tasks/test_latest_dataset_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def test_compute(self, mock_dashboard, mock_dataset):
is_('2013-10-14T00:00:00+00:00'))
assert_that(
transformed_data[0]['completion_rate'], is_(0.29334396173774413))
assert_that(
transformed_data[0]['service_id'], is_('published'))

@patch("performanceplatform.client.DataSet.from_group_and_type")
@patch("performanceplatform.client.AdminAPI.get_data_set_dashboard")
Expand Down

0 comments on commit 20389b8

Please sign in to comment.