Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error when trying to aggregate over an empty data-frame #3

Open
samdphillips opened this issue Aug 10, 2021 · 0 comments
Open
Assignees

Comments

@samdphillips
Copy link

For the following program I get this confusing error message that doesn't reflect what the cause is.

combine: contract violation
  expected: (and/c list? pair?)
  given: '()
  in: the rest argument of
      (->*
       ()
       #:rest
       (non-empty-listof data-frame?)
       data-frame?)
  contract from: <pkgs>/sawzall-lib/split.rkt
  blaming: <pkgs>/sawzall-lib/grouping.rkt
   (assuming the contract is correct)
  at: <pkgs>/sawzall-lib/split.rkt:11:16
#lang racket/base

(require data-frame
         sawzall
         threading)

(define df
  (let* ([df (make-data-frame)]
         [name (make-series "name" #:data (vector))]
         [val  (make-series "val" #:data (vector))])
    (df-add-series! df name)
    (df-add-series! df val)
    df))

(~> df
    (group-with "name")
    (aggregate [total (val) (for/sum ([n (in-vector val)]) n)]))
@ralsei ralsei self-assigned this Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants