Skip to content

table names with '.' do not get sanitized when doing a count on y-axis #933

@Light2Dark

Description

@Light2Dark

Hi, thanks for the awesome library! Ran into this issue when building a chart for a table with '.' in the column name.
Or should users sanitize the table / query beforehand? If so, how..🤔

To reproduce:

import * as vg from "@uwdata/vgplot";

vg.coordinator().databaseConnector(vg.wasmConnector());

vg.coordinator().exec(vg.loadCSV("pokemon", "https://gist.githubusercontent.com/armgilles/194bcff35001e7eb53a2a8b441e8b2c6/raw/92200bc0a673d5ce2110aaad4544ed6c4010f687/pokemon.csv"));

const chart = vg.plot(
  vg.rectY(vg.from("pokemon"), { x: "Sp. Def", y: vg.count() })
);

Error:

installHook.js:1 Error: Binder Error: Referenced table "Sp" not found!
Candidate tables: "source"

LINE 1: ..."Sp. Atk", count(*) AS "y" FROM "Pokemon" AS "source" GROUP BY "Sp"." Atk"
                                                                          ^
    at O.onMessage (duckdb-browser-DKjldGPy.js?v=bc8e0c06:12093:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions