Skip to content

Instantly share code, notes, and snippets.

@jaor
Created May 3, 2019 02:47
Show Gist options
  • Save jaor/334435aa7e595745ab5f2722cc5d8e71 to your computer and use it in GitHub Desktop.
Save jaor/334435aa7e595745ab5f2722cc5d8e71 to your computer and use it in GitHub Desktop.
(define (clean-up ds-id)
(let (ds (fetch ds-id)
fds (resource-fields ds)
fds (map (lambda (id f) (assoc f "id" id)) (keys fds) (values fds))
cf? (lambda (fd) (< (count (field-distribution fd)) 2))
excl (map (lambda (f) (f "id")) (filter cf? fds)))
(wait (create-dataset ds-id {"excluded_fields" excl}))))
(define dataset (clean-up input-dataset))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment