1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00

fix: ensure query_target is transformed after validation

Transformation must occur after validation, or else the transformation will possibly make the validation fail
This commit is contained in:
Jelson Stoelben Rodrigues 2025-05-26 20:15:21 -03:00 committed by Jason Hall
parent f67c676a2d
commit 23522da754

View file

@ -65,13 +65,13 @@ class Query(BaseModel):
self._input_plugin_manager = InputPluginManager() self._input_plugin_manager = InputPluginManager()
self.query_target = self.transform_query_target()
try: try:
self.validate_query_target() self.validate_query_target()
except InputValidationError as err: except InputValidationError as err:
raise InputInvalid(**err.kwargs) from err raise InputInvalid(**err.kwargs) from err
self.query_target = self.transform_query_target()
def summary(self) -> SimpleQuery: def summary(self) -> SimpleQuery:
"""Summarized and post-validated model of a Query.""" """Summarized and post-validated model of a Query."""
return SimpleQuery( return SimpleQuery(