Skip to content

Commit

Permalink
[MAINTENANCE] Improve typing and comment (#9534)
Browse files Browse the repository at this point in the history
  • Loading branch information
josectobar committed Feb 26, 2024
1 parent a658acf commit ccefa47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
3 changes: 2 additions & 1 deletion great_expectations/expectations/expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def _diagnostic_unexpected_statement_renderer(
assert result, "Must provide a result object."
success: Optional[bool] = result.success
result_dict: dict = result.result
exception: dict = {
exception = {
"raised_exception": False,
"exception_message": "",
"exception_traceback": "",
Expand All @@ -721,6 +721,7 @@ def _diagnostic_unexpected_statement_renderer(
exception["raised_exception"] = v["raised_exception"]
exception["exception_message"] = v["exception_message"]
exception["exception_traceback"] = v["exception_traceback"]
# This only pulls the first exception message and traceback from a list of exceptions to render in the data docs.
break

if exception["raised_exception"]:
Expand Down
18 changes: 5 additions & 13 deletions great_expectations/validator/validation_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _resolve( # noqa: C901, PLR0912, PLR0915
runtime_configuration: Optional[dict] = None,
min_graph_edges_pbar_enable: int = 0, # Set to low number (e.g., 3) to suppress progress bar for small graphs.
show_progress_bars: bool = True,
) -> Dict[_MetricKey, Dict[str, Union[MetricConfiguration, ExceptionInfo, int]],]:
) -> _AbortedMetricsInfoDict:
if metrics is None:
metrics = {}

Expand All @@ -226,10 +226,7 @@ def _resolve( # noqa: C901, PLR0912, PLR0915
else:
catch_exceptions = False

failed_metric_info: Dict[
_MetricKey,
Dict[str, Union[MetricConfiguration, ExceptionInfo, int]],
] = {}
failed_metric_info: _AbortedMetricsInfoDict = {}
aborted_metrics_info: _AbortedMetricsInfoDict = {}

ready_metrics: Set[MetricConfiguration]
Expand Down Expand Up @@ -399,10 +396,7 @@ def update(self, graph: ValidationGraph) -> None:

def get_exception_info(
self,
metric_info: Dict[
_MetricKey,
Dict[str, Union[MetricConfiguration, ExceptionInfo, int]],
],
metric_info: _AbortedMetricsInfoDict,
) -> Dict[str, Union[MetricConfiguration, ExceptionInfo, int]]:
metric_info = self._filter_metric_info_in_graph(metric_info=metric_info)
metric_exception_info: Dict[
Expand All @@ -417,10 +411,8 @@ def get_exception_info(

def _filter_metric_info_in_graph(
self,
metric_info: Dict[
_MetricKey, Dict[str, Union[MetricConfiguration, ExceptionInfo, int]]
],
) -> Dict[_MetricKey, Dict[str, Union[MetricConfiguration, ExceptionInfo, int]]]:
metric_info: _AbortedMetricsInfoDict,
) -> _AbortedMetricsInfoDict:
graph_metric_ids: List[_MetricKey] = []
edge: MetricEdge
vertex: MetricConfiguration
Expand Down

0 comments on commit ccefa47

Please sign in to comment.