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

Commit

Permalink
Add steps to trigger a manual transform to README
Browse files Browse the repository at this point in the history
Document how to perform a manual transform, which is useful if the
output data set is missing data.
  • Loading branch information
mattbostock committed Jun 2, 2015
1 parent 37f0f97 commit 96cc493
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,38 @@ command
curl -X PUT -d "[]" https://{backdrop_url}/data/<data-group>/<data-type> -H 'Authorization: Bearer <token-from-stagecraft>' -H 'Content-Type: application/json'
```

## Triggering a transform manually

A transform occurs when data is written to in Backdrop. The transform applies
calculations to the data and writes the results to a second dataset.

You may wish to trigger a transform manually if data is missing from a output
data set.

Transformations are configured in [Stagecraft][] via the API or Django admin
application.

[Stagecraft]: https://github.com/alphagov/stagecraft

1. Log in to the Stagecraft Django admin application to obtain a bearer token
for the source data set:

a. Select 'Data sets' from the 'Datasets' section in the main menu.
b. Search for the source data set
c. Make a note of the data group and data type for the data set you wish to
transform
d. Click on the name of the data set
e. Copy the bearer token from the form field

1. Run the following command, replacing the fields in capitals:

```
curl-H 'Authorization: Bearer <INSERT BEARER TOKEN HERE>' \
-H 'content-type: application/json' \
-d '{"_start_at": "2012-01-01T00:00:00Z", "_end_at": "2015-03-20T00:00:00Z"}' \
https://www.performance.service.gov.uk/data/<DATA GROUP>/<DATA TYPE>/transform
```

## Celery worker

Backdrop uses celery for running tasks on data post write - these can be found
Expand Down

0 comments on commit 96cc493

Please sign in to comment.