Bug Report
Steps to Reproduce:
package.json:
{
"name": "perspective-underscore-alias-repro",
"version": "1.0.0",
"private": true,
"type": "module",
"description": "repro",
"scripts": {
"repro": "node repro.mjs"
},
"dependencies": {
"@perspective-dev/client": "4.5.1"
}
}
repro.mjs:
import { GenericSQLVirtualServerModel } from '@perspective-dev/client/node';
const model = new GenericSQLVirtualServerModel();
const sql = model.tableMakeView('memory.t', 'v', {
sort: [],
group_by: [],
split_by: [],
columns: ['account_number'],
filter: [],
expressions: {},
aggregates: {},
});
console.log(sql);
// CREATE TABLE v AS (SELECT "account_number" as "account-number" FROM memory.t ORDER BY rowid)
To run:
Expected Result:
Column names with underscores (eg account_name) are passed through unchanged.
Actual Result:
Underscores are replaced with hyphens, so account_name becomes account-name.
In addition to not matching the underlying data, this leads to issues using the datatable, because the table "data" uses the mangled names, but the column picker uses the correct (ie underscore) names. Additionally, sorting breaks with error messages like "Uncaught (in promise) Error: Unknown column "account-name" in field sort" because the names don't match the actual columns:

Bug Report
Steps to Reproduce:
package.json:{ "name": "perspective-underscore-alias-repro", "version": "1.0.0", "private": true, "type": "module", "description": "repro", "scripts": { "repro": "node repro.mjs" }, "dependencies": { "@perspective-dev/client": "4.5.1" } }repro.mjs:To run:
Expected Result:
Column names with underscores (eg
account_name) are passed through unchanged.Actual Result:
Underscores are replaced with hyphens, so
account_namebecomesaccount-name.In addition to not matching the underlying data, this leads to issues using the datatable, because the table "data" uses the mangled names, but the column picker uses the correct (ie underscore) names. Additionally, sorting breaks with error messages like "Uncaught (in promise) Error: Unknown column "account-name" in field
sort" because the names don't match the actual columns: