Skip to content

Instantly share code, notes, and snippets.

@whizzmler
Last active November 2, 2019 17:40
Show Gist options
  • Save whizzmler/917a05cf6c173381116e3cc02da70e42 to your computer and use it in GitHub Desktop.
Save whizzmler/917a05cf6c173381116e3cc02da70e42 to your computer and use it in GitHub Desktop.
One-Click Dataset from a Source
{
"name": "One-Click Dataset",
"description": "Create a new dataset from a source with a click",
"outputs": [
{"name": "dataset-id", "type": "dataset-id", "description": "The new dataset"},
{"name": "rows", "type": "number", "description": "The number of rows of the new dataset"}
],
"inputs": [
{"name": "source-id", "type": "source-id", "default": "", "description": "Source from which to create a new dataset"},
{"name": "source-name", "type": "string", "default": "", "description": "Name for the new dataset"}
]
}
(define (make-dataset id name)
(let (ds-id (create-and-wait-dataset {"source" id
"name" name}))
(fetch ds-id)))
(define dataset (make-dataset source-id source-name))
(define dataset-id (get dataset "resource"))
(define rows (get dataset "rows"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment