Skip to content

Commit 7f6ef58

Browse files
authored
fix(arithmetic): removing equation from autocomplete/yaxis (#26600)
- Equations were showing up in autocomplete and the y-axis even though they're not currently supported in either, but because they're in the list of fields were being picked up by these two things
1 parent 5bbbc25 commit 7f6ef58

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

static/app/components/events/searchBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
Field,
1717
FIELD_TAGS,
1818
isAggregateField,
19+
isEquation,
1920
isMeasurement,
2021
TRACING_FIELDS,
2122
} from 'app/utils/discover/fields';
@@ -101,7 +102,10 @@ class SearchBar extends React.PureComponent<SearchBarProps> {
101102
const functionTags = fields
102103
? Object.fromEntries(
103104
fields
104-
.filter(item => !Object.keys(FIELD_TAGS).includes(item.field))
105+
.filter(
106+
item =>
107+
!Object.keys(FIELD_TAGS).includes(item.field) && !isEquation(item.field)
108+
)
105109
.map(item => [item.field, {key: item.field, name: item.field}])
106110
)
107111
: {};

static/app/utils/discover/eventView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,10 @@ class EventView {
11571157
return uniqBy(
11581158
this.getAggregateFields()
11591159
// Only include aggregates that make sense to be graphable (eg. not string or date)
1160-
.filter((field: Field) => isLegalYAxisType(aggregateOutputType(field.field)))
1160+
.filter(
1161+
(field: Field) =>
1162+
isLegalYAxisType(aggregateOutputType(field.field)) && !isEquation(field.field)
1163+
)
11611164
.map((field: Field) => ({label: field.field, value: field.field}))
11621165
.concat(CHART_AXIS_OPTIONS),
11631166
'value'

0 commit comments

Comments
 (0)