Skip to content

Commit

Permalink
[DOCS] Misc docstrings around DataAssistant (great-expectations#6866)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdkini authored Jan 20, 2023
1 parent 4a615cf commit c9f6b81
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -517,6 +518,7 @@ def __init__(
rule.parameter_builders or []
)

@public_api
def run(
self,
variables: Optional[Dict[str, Any]] = None,
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,24 +507,24 @@ def _get_expectation_suite_without_usage_statistics(

return expectation_suite

@public_api
def plot_metrics(
self,
sequential: bool = True,
theme: Optional[Dict[str, Any]] = None,
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.
Expand All @@ -537,24 +537,24 @@ def plot_metrics(
exclude_column_names=exclude_column_names,
)

@public_api
def plot_expectations_and_metrics(
self,
sequential: bool = True,
theme: Optional[Dict[str, Any]] = None,
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.
Expand Down

0 comments on commit c9f6b81

Please sign in to comment.