Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aficionado/3c9bcfbb58bd2166c55984c8965a2ab9 to your computer and use it in GitHub Desktop.
Save aficionado/3c9bcfbb58bd2166c55984c8965a2ab9 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"}
],
"parameters": [
{"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