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

Why Error: Illegal function call? and this library seems very limited unable to call general JS code? #5

Closed
t829702 opened this issue Sep 25, 2020 · 2 comments
Labels
question Further information is requested

Comments

@t829702
Copy link
Contributor

t829702 commented Sep 25, 2020

Error: Illegal function call: "Date.UTC(d.year, 0, 1)"
aq.table({ year: [2010, 2011, 2012, 2013, 2019, ] })
  .derive({ date: d => Date.UTC(d.year, 0, 1) })
  .view()
@jheer
Copy link
Member

jheer commented Sep 25, 2020

Arquero reparses and optimizes expressions, and for safety and future portability reasons only allows function calls provided by the op object. This is described in the introduction tutorial and formal documentation will later be added to the Arquero docs.

The full documentation for the op object is here: https://uwdata.github.io/arquero/api/op, and includes date-time methods.

@jheer jheer added the question Further information is requested label Sep 25, 2020
@jheer
Copy link
Member

jheer commented Sep 25, 2020

Note that you can also register custom op functions using the top-level addFunction method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants