Skip to content

Instantly share code, notes, and snippets.

@mmerce
Last active August 25, 2017 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmerce/34ca211afcf05d183c5b2a94bb01b6bc to your computer and use it in GitHub Desktop.
Save mmerce/34ca211afcf05d183c5b2a94bb01b6bc to your computer and use it in GitHub Desktop.
Unite datasets
{
"name": "Unite datasets",
"description": "Creating a dataset that contains the data in several datasets tagged with an identifier.",
"inputs": [
{
"name": "tag",
"type": "string",
"description": "tag identifier"
}
],
"outputs": [
{
"name": "union-dataset",
"type": "dataset-id",
"description": "Dataset containing the union of instances in all the datasets that share a tag."
}
]
}
(define (unite-datasets tag)
(let (datasets (map (lambda (d) (d "resource")) (list-datasets {"tags__in" tag "reverse" true})))
(update-and-wait (create-and-wait-dataset {"origin_datasets" datasets}) {"tags" []})))
(define union-dataset (unite-datasets tag))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment