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

unexpected number in JSON at position X when running query for map vis #1551

Open
tboulis opened this issue Dec 19, 2024 · 3 comments
Open
Labels
p3 Priority 3

Comments

@tboulis
Copy link

tboulis commented Dec 19, 2024

We encountered an issue while fetching the underlying data of a map vis:
image

The issue is that the response of the looker api contains invalid JSON objects for the field users.approx_location which fails to be parsed using the typescript sdk.
I tested it on the API Explorer on the looker website and I saw that the data looks like this:
image
which obviously is not a valid object.

Is this a known issue and does it apply to all map vises or is it just an isolated issue that is related to the sample data for partner instances?

Edit

I tested both
GET /queries/49/run/json_bi
and
POST /queries/run/json_bi
and both returned the same bad data

Part of data:

 ...
 "rows": [
    {
      "users.approx_location": {
        "value": 33.8,
        -118.3
      },
      "users.country": {
        "value": "USA"
      },
      "order_items.order_count": {
        "Female": {
          "value": "730"
        },
        "Male": {
          "value": "824"
        },
        "null": {
          "value": null
        }
      },
      "users.count": {
        "Female": {
          "value": "643"
        },
        "Male": {
          "value": "682"
        },
        "null": {
          "value": null
        }
      },
      "order_items.total_sale_price": {
        "Female": {
          "value": "$39,194.18"
        },
        "Male": {
          "value": "$46,958.68"
        },
        "null": {
          "value": null
        }
      },
      "order_items.average_spend_per_user": {
        "Female": {
          "value": "$60.96"
        },
        "Male": {
          "value": "$68.85"
        },
        "null": {
          "value": null
        }
      }
    },
    {
      "users.approx_location": {
        "value": 33.8,
        -118.3
      },
      "users.country": {
        "value": "USA"
      },
      "order_items.order_count": {
        "Female": {
          "value": "698"
        },
        "Male": {
          "value": "506"
        },
        "null": {
          "value": null
        }
      },
      "users.count": {
        "Female": {
          "value": "610"
        },
        "Male": {
          "value": "453"
        },
        "null": {
          "value": null
        }
      },
      "order_items.total_sale_price": {
        "Female": {
          "value": "$36,832.17"
        },
        "Male": {
          "value": "$26,203.86"
        },
        "null": {
          "value": null
        }
      },
      "order_items.average_spend_per_user": {
        "Female": {
          "value": "$60.38"
        },
        "Male": {
          "value": "$57.85"
        },
        "null": {
          "value": null
        }
      }
    },
   ...
@github-actions github-actions bot added p3 Priority 3 need triage labels Dec 19, 2024
@drstrangelooker
Copy link
Collaborator

This may be a looker API bug rather than a typescript sdk bug. Can you open the looker bug through the normal channels?

Thanks
Mike

@drstrangelooker
Copy link
Collaborator

I tried running a query via API Explorer for a location field and it seemed to work properly...

  "rows": [
    {
      "airports.map_location": {
        "value": [
          40.63,
          -73.77
        ]
      },

What is the data type of the field "users.approx_location"?

@tboulis
Copy link
Author

tboulis commented Dec 24, 2024

Hello @drstrangelooker thank you for looking into this.
It seems that it is of type location:
image

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

No branches or pull requests

2 participants