Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Improve typing and comment #9534

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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