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

panic calling map() with non-existent column: got "invalid" expected "array #3374

Closed
abalone23 opened this issue Dec 3, 2020 · 1 comment · Fixed by #3384
Closed

panic calling map() with non-existent column: got "invalid" expected "array #3374

abalone23 opened this issue Dec 3, 2020 · 1 comment · Fixed by #3384
Assignees
Labels

Comments

@abalone23
Copy link

abalone23 commented Dec 3, 2020

A panic happens when calling map() with non-existent column:

panic: unexpected kind: got "invalid" expected "array"

Flux: v0.96.1

data = from(bucket: "_tasks")
  |> range(start: -1m)
  |> filter(fn: (r) => (r["_measurement"] == "runs"))
  |> filter(fn: (r) => (r["_field"] == "logs"))
  |> filter(fn: (r) => (r["status"] == "success"))
  |> last()
  |> map(fn: (r) => ({ r with newColumn: r.abc[0] }))
  |> yield()

flux-panic

Note that the panic doesn't happen with abc[0]. In that case the error is:

undefined identifier abc

@danxmoran
Copy link
Contributor

danxmoran commented Dec 10, 2020

EDIT: Sorry, got my tabs got mixed up 🤦

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

Successfully merging a pull request may close this issue.

4 participants