@malloydata/malloy 0.0.81-dev230910191735 → 0.0.81-dev230910215631
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.
|
@@ -263,9 +263,7 @@ function validateUsagePaths(functionName, usagePaths) {
|
|
|
263
263
|
else if (step.structRelationship.type === 'many' && !step.reverse) {
|
|
264
264
|
return `Cannot compute \`${functionName}\` across \`join_many\` relationship \`${step.name}\``;
|
|
265
265
|
}
|
|
266
|
-
else if (step.structRelationship.type === 'nested' &&
|
|
267
|
-
step.structRelationship.isArray &&
|
|
268
|
-
!step.reverse) {
|
|
266
|
+
else if (step.structRelationship.type === 'nested' && !step.reverse) {
|
|
269
267
|
return `Cannot compute \`${functionName}\` across repeated relationship \`${step.name}\``;
|
|
270
268
|
}
|
|
271
269
|
}
|
|
@@ -177,7 +177,6 @@ describe('expressions', () => {
|
|
|
177
177
|
rename: column is ai
|
|
178
178
|
rename: nested is astruct
|
|
179
179
|
rename: inline is aninline
|
|
180
|
-
rename: inline2 is anonrepeatedstruct
|
|
181
180
|
dimension: field is column * 2
|
|
182
181
|
dimension: many_field is many.column * 2
|
|
183
182
|
dimension: many_one_field is many.column + one.column
|
|
@@ -314,15 +313,6 @@ describe('expressions', () => {
|
|
|
314
313
|
test('source.sum(inline.column)', () => {
|
|
315
314
|
expect(modelX `source.sum(inline.column)`).toTranslate();
|
|
316
315
|
});
|
|
317
|
-
test('sum(inline2.column)', () => {
|
|
318
|
-
expect(modelX `sum(inline2.column)`).toTranslateWithWarnings('Join path is required for this calculation; use `inline2.column.sum()` or `source.sum(inline2.column)` to get a result weighted with respect to `source`');
|
|
319
|
-
});
|
|
320
|
-
test('inline2.column.sum()', () => {
|
|
321
|
-
expect(modelX `inline2.column.sum()`).toTranslate();
|
|
322
|
-
});
|
|
323
|
-
test('source.sum(inline2.column)', () => {
|
|
324
|
-
expect(modelX `source.sum(inline2.column)`).toTranslate();
|
|
325
|
-
});
|
|
326
316
|
test('sum(many.field)', () => {
|
|
327
317
|
expect(modelX `sum(many.field)`).translationToFailWith('Join path is required for this calculation; use `many.field.sum()`');
|
|
328
318
|
});
|
|
@@ -59,14 +59,6 @@ const mockSchema = {
|
|
|
59
59
|
fields: [{ type: 'number', name: 'column', numberType: 'integer' }],
|
|
60
60
|
dialect: 'standardsql',
|
|
61
61
|
},
|
|
62
|
-
{
|
|
63
|
-
type: 'struct',
|
|
64
|
-
name: 'anonrepeatedstruct',
|
|
65
|
-
structSource: { type: 'nested' },
|
|
66
|
-
structRelationship: { type: 'nested', isArray: false, field: 'foo' },
|
|
67
|
-
fields: [{ type: 'number', name: 'column', numberType: 'integer' }],
|
|
68
|
-
dialect: 'standardsql',
|
|
69
|
-
},
|
|
70
62
|
{
|
|
71
63
|
type: 'struct',
|
|
72
64
|
name: 'aninline',
|