diff --git a/great_expectations/rule_based_profiler/data_assistant/data_assistant.py b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py index cb7f6918e262..1f0b5fee5b24 100644 --- a/great_expectations/rule_based_profiler/data_assistant/data_assistant.py +++ b/great_expectations/rule_based_profiler/data_assistant/data_assistant.py @@ -2,6 +2,7 @@ from inspect import isabstract from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union +from great_expectations.core._docs_decorators import public_api from great_expectations.core.batch import Batch, BatchRequestBase from great_expectations.core.domain import Domain, SemanticDomainTypes from great_expectations.core.id_dict import deep_convert_properties_iterable_to_id_dict @@ -517,6 +518,7 @@ def __init__( rule.parameter_builders or [] ) + @public_api def run( self, variables: Optional[Dict[str, Any]] = None, @@ -528,17 +530,27 @@ def run( List[RuntimeEnvironmentDomainTypeDirectives] ] = None, ) -> DataAssistantResult: - """ - Run the DataAssistant as it is currently configured. + """Run the DataAssistant as it is currently configured. + + Example Usage:: + + data_assistant = VolumeDataAssistant( + name="my_volume_data_assistant", + validator=validator, + ) + result: DataAssistantResult = data_assistant.run( + variables=None, + rules=None, + ) Args: - variables: attribute name/value pairs (overrides), commonly-used in Builder objects - rules: name/(configuration-dictionary) (overrides) - variables_directives_list: additional/override runtime variables directives (modify "BaseRuleBasedProfiler") - domain_type_directives_list: additional/override runtime domain directives (modify "BaseRuleBasedProfiler") + variables: Attribute name/value pairs (overrides); commonly-used in Builder objects. + rules: Name/configuration dictionary (overrides) + variables_directives_list: Additional/override runtime variables directives (modify `BaseRuleBasedProfiler`). + domain_type_directives_list: Additional/override runtime domain directives (modify `BaseRuleBasedProfiler`). Returns: - DataAssistantResult: The result object for the DataAssistant + An instance of `DataAssistantResult`. """ usage_statistics_handler: Optional[UsageStatisticsHandler] if self._data_context is None: diff --git a/great_expectations/rule_based_profiler/data_assistant_result/data_assistant_result.py b/great_expectations/rule_based_profiler/data_assistant_result/data_assistant_result.py index 7233f3dcf4dd..65705344cd6f 100644 --- a/great_expectations/rule_based_profiler/data_assistant_result/data_assistant_result.py +++ b/great_expectations/rule_based_profiler/data_assistant_result/data_assistant_result.py @@ -507,6 +507,7 @@ def _get_expectation_suite_without_usage_statistics( return expectation_suite + @public_api def plot_metrics( self, sequential: bool = True, @@ -514,17 +515,16 @@ def plot_metrics( include_column_names: Optional[List[str]] = None, exclude_column_names: Optional[List[str]] = None, ) -> PlotResult: - """ - Use contents of "DataAssistantResult" object to display metrics for visualization purposes. + """Use contents of `DataAssistantResult` object to display metrics for visualization purposes. Altair theme configuration reference: https://altair-viz.github.io/user_guide/configuration.html#top-level-chart-configuration Args: - sequential: Whether the batches are sequential or not - theme: Altair top-level chart configuration dictionary - include_column_names: Columns to include in metrics plot - exclude_column_names: Columns to exclude from metrics plot + sequential: Whether the batches are sequential or not. + theme: Altair top-level chart configuration dictionary. + include_column_names: Columns to include in metrics plot. + exclude_column_names: Columns to exclude from metrics plot. Returns: PlotResult wrapper object around Altair charts. @@ -537,6 +537,7 @@ def plot_metrics( exclude_column_names=exclude_column_names, ) + @public_api def plot_expectations_and_metrics( self, sequential: bool = True, @@ -544,17 +545,16 @@ def plot_expectations_and_metrics( include_column_names: Optional[List[str]] = None, exclude_column_names: Optional[List[str]] = None, ) -> PlotResult: - """ - Use contents of "DataAssistantResult" object to display metrics and expectations for visualization purposes. + """Use contents of `DataAssistantResult` object to display metrics and expectations for visualization purposes. Altair theme configuration reference: https://altair-viz.github.io/user_guide/configuration.html#top-level-chart-configuration Args: - sequential: Whether the batches are sequential or not - theme: Altair top-level chart configuration dictionary - include_column_names: Columns to include in expectations and metrics plot - exclude_column_names: Columns to exclude from expectations and metrics plot + sequential: Whether the batches are sequential or not. + theme: Altair top-level chart configuration dictionary. + include_column_names: Columns to include in expectations and metrics plot. + exclude_column_names: Columns to exclude from expectations and metrics plot. Returns: PlotResult wrapper object around Altair charts.