@malloydata/malloy 0.0.105-dev231127212430 → 0.0.105

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.
package/dist/malloy.d.ts CHANGED
@@ -604,6 +604,9 @@ export declare class AtomicField extends Entity implements Taggable {
604
604
  isTimestamp(): this is TimestampField;
605
605
  isUnsupported(): this is UnsupportedField;
606
606
  get parentExplore(): Explore;
607
+ /**
608
+ * @return Field name for drill.
609
+ */
607
610
  get expression(): string;
608
611
  get location(): DocumentLocation | undefined;
609
612
  }
package/dist/malloy.js CHANGED
@@ -1264,9 +1264,18 @@ class AtomicField extends Entity {
1264
1264
  get parentExplore() {
1265
1265
  return this.parent;
1266
1266
  }
1267
+ /**
1268
+ * @return Field name for drill.
1269
+ */
1267
1270
  get expression() {
1268
- var _a;
1269
- return ((_a = this.fieldTypeDef.resultMetadata) === null || _a === void 0 ? void 0 : _a.sourceExpression) || this.name;
1271
+ const dot = '.';
1272
+ const resultMetadata = this.fieldTypeDef.resultMetadata;
1273
+ // If field is joined-in from another table i.e. of type `tableName.columnName`,
1274
+ // return sourceField, else return name because this could be a renamed field.
1275
+ return (resultMetadata === null || resultMetadata === void 0 ? void 0 : resultMetadata.sourceExpression) ||
1276
+ (resultMetadata === null || resultMetadata === void 0 ? void 0 : resultMetadata.sourceField.includes(dot))
1277
+ ? resultMetadata === null || resultMetadata === void 0 ? void 0 : resultMetadata.sourceField
1278
+ : this.name;
1270
1279
  }
1271
1280
  get location() {
1272
1281
  return this.fieldTypeDef.location;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.105-dev231127212430",
3
+ "version": "0.0.105",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",