Coder Social home page Coder Social logo

cannot get property correctly about vega HOT 4 CLOSED

I075818 avatar I075818 commented on May 18, 2024
cannot get property correctly

from vega.

Comments (4)

domoritz avatar domoritz commented on May 18, 2024

Thanks for the report. Can you provide a minimal reproducible example that demonstrates the issue?

from vega.

I075818 avatar I075818 commented on May 18, 2024

Hi domoritz,
Please use this json to debug.

{
    "$schema": "https://vega.github.io/schema/vega/v5.json",
    "description": "A timeline visualization of the lives of the first five U.S. presidents.",
    "data": [
        {
            "name": "testdata",
            "values": [
                {
                    "_index": "metrics-otel-v1-2023.09.06",
                    "_type": "_doc",
                    "_id": "_YH3aIoBwqxJSF1N_aqW",
                    "_source": {
                        "kind": "SUMMARY",
                        "count": 5,
                        "flags": 0,
                        "description": "POC metrics for outbound request",
                        "sum": 7.003,
                        "name": "outbound_request_seconds",
                        "startTime": "2023-09-06T04:35:22.773Z",
                        "quantileValuesCount": 2,
                        "time": "2023-09-06T05:29:52.773Z",
                        "metric.attributes.pod_id": "p2"
                    }
                },
                {
                    "_index": "metrics-otel-v1-2023.09.06",
                    "_type": "_doc",
                    "_id": "_4H3aIoBwqxJSF1N_aqW",
                    "_source": {
                        "kind": "SUMMARY",
                        "count": 5,
                        "flags": 0,
                        "description": "POC metrics for outbound request",
                        "sum": 5.563,
                        "name": "outbound_request_seconds",
                        "startTime": "2023-09-06T05:03:22.773Z",
                        "quantileValuesCount": 2,
                        "time": "2023-09-06T05:29:52.773Z",
                        "metric.attributes.pod_id": "p1"
                    }
                }
            ],
            "transform": [
                {
                    "type": "filter",
                    "expr": "datum._source.name == 'outbound_request_seconds'"
                }
            ]
        },
        {
            "name": "groupbyPod",
            "source": "testdata",
            "transform": [
                {
                    "type": "aggregate",
                    "ops": [
                        "sum"
                    ],
                    "fields": [
                        "_source.count"
                    ],
                    "as": [
                        "s1"
                    ],
                    "groupby": [
                        "_source.metric.attributes.pod_id"
                    ]
                }
            ]
        }
    ]
}

from vega.

PBI-David avatar PBI-David commented on May 18, 2024

There are no marks in your sample spec. Regardless, I think you just need to escape any property names containing . with \\.

e.g. "_source\\.metric\\.attributes\\.pod_id"

from vega.

I075818 avatar I075818 commented on May 18, 2024

Thank you very much!

from vega.

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.