Skip to content

Commit

Permalink
Add custom message to validation decorator (pinterest#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgopal492 authored and aidenprice committed Jan 3, 2024
1 parent 49a413f commit f54d380
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@ def _get_query_validation_result(
end_index: int,
suggestion: str = None,
validation_result_object_type=QueryValidationResultObjectType.LINT,
message: str = None,
):
if message is None:
message = self.message
start_line, start_ch = self._get_query_coordinate_by_index(query, start_index)
end_line, end_ch = self._get_query_coordinate_by_index(query, end_index)

return QueryValidationResult(
start_line,
start_ch,
self.severity,
self.message,
message,
validation_result_object_type,
end_line=end_line,
end_ch=end_ch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ class PrestoOptimizingValidator(BaseQueryValidator):
def languages(self):
return ["presto", "trino"]

@property
def tokenizer(self) -> Tokenizer:
return Trino.Tokenizer()

def _get_explain_validator(self):
return PrestoExplainValidator("")

Expand Down

0 comments on commit f54d380

Please sign in to comment.