@malloydata/malloy 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -940,7 +940,7 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
940
940
|
}
|
|
941
941
|
visitExprCountDisinct(pcx) {
|
|
942
942
|
if (this.m4WarningsEnabled()) {
|
|
943
|
-
this.contextError(pcx,
|
|
943
|
+
this.contextError(pcx, '`count(distinct expression)` deprecated, use `count(expression)` instead', 'warn');
|
|
944
944
|
}
|
|
945
945
|
return this.astAt(new ast.ExprCountDistinct(this.getFieldExpr(pcx.fieldExpr())), pcx);
|
|
946
946
|
}
|
|
@@ -423,6 +423,13 @@ describe('expressions', () => {
|
|
|
423
423
|
calculate: bar is lag(sum(output))
|
|
424
424
|
}`).translationToFailWith("'output' is not defined");
|
|
425
425
|
});
|
|
426
|
+
test('count(distinct column)', () => {
|
|
427
|
+
expect((0, test_translator_1.model) `
|
|
428
|
+
##! m4warnings
|
|
429
|
+
run: a -> {
|
|
430
|
+
aggregate: x is count(distinct astr)
|
|
431
|
+
}`).toTranslateWithWarnings('`count(distinct expression)` deprecated, use `count(expression)` instead');
|
|
432
|
+
});
|
|
426
433
|
});
|
|
427
434
|
describe('pick statements', () => {
|
|
428
435
|
test('full', () => {
|