File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
static/app/views/explore/metrics Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ export function EquationBuilder({
102102 new Set ( Object . keys ( expressionMapRef . current ?? { } ) )
103103 ) ;
104104 const resolved = resolveExpression ( expr , referenceMap ) ;
105- if ( resolved . isValid ) {
105+
106+ // Check the validity of the internal expression, not the resolved one because
107+ // there are issues with validating it with the new _if aggregation format and
108+ // this check just needs to ensure the structure is valid.
109+ if ( expr . isValid ) {
106110 handleExpressionChange ( resolved ) ;
107111 expressionMapRef . current = referenceMap ;
108112 }
@@ -112,7 +116,9 @@ export function EquationBuilder({
112116 const handleInternalExpressionChange = useCallback (
113117 ( newExpression : Expression ) => {
114118 startTransition ( ( ) => {
115- handleExpressionChange ( resolveExpression ( newExpression , referenceMap ) ) ;
119+ if ( newExpression . isValid ) {
120+ handleExpressionChange ( resolveExpression ( newExpression , referenceMap ) ) ;
121+ }
116122 } ) ;
117123 } ,
118124 [ handleExpressionChange , referenceMap ]
Original file line number Diff line number Diff line change @@ -60,10 +60,6 @@ export function MetricToolbar({
6060
6161 const handleExpressionChange = useCallback (
6262 ( newExpression : Expression ) => {
63- const isValid = newExpression . isValid ;
64- if ( ! isValid ) {
65- return ;
66- }
6763 setVisualize ( visualize . replace ( { yAxis : `${ EQUATION_PREFIX } ${ newExpression . text } ` } ) ) ;
6864 } ,
6965 [ setVisualize , visualize ]
You can’t perform that action at this time.
0 commit comments