justinpark commented on code in PR #35009:
URL: https://github.com/apache/superset/pull/35009#discussion_r2323823290


##########
superset/jinja_context.py:
##########
@@ -767,6 +769,12 @@ def process_template(self, sql: str, **kwargs: Any) -> str:
             raise SupersetTemplateException(
                 "Infinite recursion detected in template"
             ) from ex
+        except UndefinedError:
+            return sql
+        except Exception as ex:
+            if "undefined" in str(ex).lower():

Review Comment:
   Is catching the case of `undefined` here the same as catching the case of a 
void return below?
   ```
                   if re.search(function_pattern, original_sql, re.IGNORECASE):
                       return
   ```
   I think that, rather than catching the error using something like 
`str(err)`, it would be better to add a custom Exception, raise it, and catch 
it accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to