Giter Site home page Giter Site logo

Comments (16)

marcusolsson avatar marcusolsson commented on September 3, 2024 1

Yeah, you're right.

Zeros:

  • [0, 0, 0] becomes [NaN, NaN, NaN]
  • [0, 0, 1] becomes [0, 0, 1]

Booleans:

  • [false, false, false] becomes [NaN, NaN, NaN]
  • [false, false, true] becomes [false, false, true]

Looks like it fails when all values are "falsy".

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024 1

and please note that it was working fine in previous version

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024 1

I've found the issue, and working on a fix.

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024 1

Fixed in v0.7.1. Let me know if you're still having issues!

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024 1

i apreciate well your reactivity :)
V0.7.1 is working like a charm
Thanks

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024

Thank you for reporting this! I'll look into it πŸ‘

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

thanks for you prompt action
i forget to mention that i'm using Table plugin

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024

Could you paste the JSON and the query you are using, so that I reproduce this?

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

i'm using a private backend so you don't have acess to it
but will give you some outputs πŸ‘

Path : /client Query string : type=X&attributes=*

$.client[?(@.name=='$name')].name
$.client[?(@.name=='$name')].status.child

{
"request": {
"url": "api/datasources/proxy/9/client?type=X&attributes=*",
"method": "GET",
"hideFromInspector": false
},
"response": {
"client": [
{
"name": "XXXXX",
"status": {
"child": 0
},
"type": "X"
}
]
}
}

anyway you can reproduce it using any data with 0 as a value

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024

I tried with this JSON:

[
  {"number": 0, "boolean": false},
  {"number": 2, "boolean": true}
]

which seems to work

Screen Shot 2020-12-07 at 16 26 20

from grafana-json-datasource.

marcusolsson avatar marcusolsson commented on September 3, 2024

I can reproduce it with your example. I think the error occurs when there's only one item in the array.

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

i don't think it related to the number of items

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

since i have the same behaviour with a lot of items

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

in fact in depends on the selct Json Path
if you select just one item based on some creteria you have the problem

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

and if you do not choose any filter like (?(@.name=='$name') it should be ok

from grafana-json-datasource.

abenbouz avatar abenbouz commented on September 3, 2024

perfect thanks

from grafana-json-datasource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.