Skip to content

Commit

Permalink
DO NOT MERGE: hack to save code
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydtabb committed Dec 12, 2024
1 parent 65f84f3 commit 25da4ae
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"third-party-licenses": "ts-node scripts/third_party_licenses",
"malloyc": "ts-node scripts/malloy-to-json",
"build-duckdb-db": "ts-node scripts/build_duckdb_test_database",
"ping-db": "ts-node ./test/bin/ping_db.ts"
"ping-db": "ts-node ./test/bin/ping_db.ts",
"describe-cube": "ts-node scripts/describe_cube.ts"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.23.3",
Expand Down
34 changes: 34 additions & 0 deletions scripts/describe_cube.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import t from '/Users/ltabb/Downloads/agg_levels.json';

const allDims = new Map<string, string>();

for (const a of t) {
for (const dim of a.agg_level.split('.')) {
allDims.set(dim, 'x');
}
}

console.log(`

Check warning on line 11 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Unexpected console statement
##! experimental{composite_sources}
source: cube_root is presto_de.table('peu_cube_agg_level:measurementsystems')`);

for (const cube of t) {
const name = '`cube' + cube.agg_level + '`';

Check failure on line 16 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

'name' is assigned a value but never used. Allowed unused vars must match /^_/u
const levels = cube.agg_level.split('.');
const except =
'`' +
Array.from(allDims.keys())
.filter(x => !levels.includes(x))
.join('`,`') +
'`';
console.log(`

Check warning on line 24 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Unexpected console statement
source: \`cube.${cube.agg_level}\` is cube_root extend {
except: ${except}
where: agg_level = '${cube.agg_level}'
}
`);
}

console.log(`source: cube_base is compose(`);

Check warning on line 32 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Unexpected console statement

Check warning on line 32 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Strings must use singlequote
console.log('`' + t.map(x => 'cube.' + x.agg_level).join('`,`') + '`');

Check warning on line 33 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Unexpected console statement
console.log(`)`);

Check warning on line 34 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Unexpected console statement

Check warning on line 34 in scripts/describe_cube.ts

View workflow job for this annotation

GitHub Actions / test-all (18.x)

Strings must use singlequote

0 comments on commit 25da4ae

Please sign in to comment.