question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to filter out null objects if referenced by encoding

See original GitHub issue
{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "description": "Unable to truly filter data",
  "data": {
    "values":[
      {
        "date": "2000-01-01"
      },
      {
        "date": "2000-02-01",
        "options": {
          "price": 16 
        }
      },
      {
        "date": "2000-03-01",
        "options": {
          "price": 17 
        }
      } 
    ]
  },
  "transform": [{"filter": "datum.options != null"}],
  "mark": "line",
  "encoding": {
    "x": {"field": "date", "type": "temporal", "axis": {"format": "%Y"}},
    "y": {"field": "options.price", "type": "quantitative"}
  }
}

This will throw “ERROR TypeError: Cannot read property ‘price’ of undefined” in the console. I’m not sure why “options.price” would ever try to be evaluated for the record which was supposed to be filtered out.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
LucidObscuritycommented, Apr 28, 2018

Nice. I do love the simplicity of Vega-Lite for most scenarios.

0reactions
domoritzcommented, Apr 29, 2018

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Linq's Where/Select to filter out null and convert the type ...
In my project I have nullable reference warnings turned to errors, so the commented out line below will not compile. If I do...
Read more >
Avoid Check for Null Statement in Java - Baeldung
Learn several strategies for avoiding the all-too-familiar boilerplate conditional statements to check for null values in Java.
Read more >
2 Serialization Filtering - Java - Oracle Help Center
An object is deserialized when its serialized form is converted to a copy of the object. It is important to ensure the security...
Read more >
Using filters to manipulate data - Ansible Documentation
Defining different values for true/false/null (ternary) ... By default, Ansible fails if a variable in your playbook or command is undefined.
Read more >
Use query parameters to customize responses - Microsoft Graph
If a query is failing, one possible cause is failure to encode the query parameter values appropriately. In some cases, you may have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found