Skip to content

Core sends an incorrect query when it knows there is no data to expect #45

@angiehjort

Description

@angiehjort

The issue happens on vizabi mountain-chart + small-waffle, when the billy feature is disabled

mountain chart sends a query with empty "select.value" array to Billy dataset

LINK

To which ddfcsv reader in small waffle errors and pollutes the error log. Returns 500.

2024-07-11T14:54:52: Too many query structure errors:
2024-07-11T14:54:52: * 'select.value' clause for 'datapoints' queries must have at least 1 item undefined
2024-07-11T14:54:52:
2024-07-11T14:54:52:   InternalServerError: Internal Server Error

Big-waffle would gracefully return an empty array in this case (try)

Response:

{
"version":"bb66a61",
"header":["person","time"],
"rows": [

]}

billy mark has the config as provided before.
notice how concept is null in many places, and the value for concept it is instead kept in "stash"

      billy: {
        data: {
          space: ["person", "time"],
          source: "billy"
        },
        requiredEncodings: ["x"],
        encoding: {
          x: {
            data: {
              space: ["person", "time"],
              concept: null,
              stash: "daily_income"
            }
          },

// BLABLABLA, full config in the comment
       }
      }

when needed, there is a UI logic that pulls the values out of stash, currently here

      if (showBilly)
        for (let enc of encs)
          marker.encoding[enc].data.config.concept = marker.encoding[enc].data.config.stash;
      else
        for (let enc of encs)
          marker.encoding[enc].data.config.concept = null;

this is a weird pattern but whatever.
it would be nice to add a protection on vizabi core level, which would detect such situation and not send any query as it is known that there will be no data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions