Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Sherstinsky committed May 18, 2023
1 parent e5d0da1 commit cf5d1bb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
19 changes: 17 additions & 2 deletions great_expectations/validator/metrics_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def show_progress_bars(self, enable: bool) -> None:
def columns(self, domain_kwargs: Optional[Dict[str, Any]] = None) -> List[str]:
"""
Convenience method to run "table.columns" metric.
Arguments:
domain_kwargs: Optional dictionary of domain kwargs (e.g., containing "batch_id").
Returns:
The list of Batch columns.
"""
if domain_kwargs is None:
domain_kwargs = {}
Expand All @@ -71,8 +77,17 @@ def head(
domain_kwargs: Optional[Dict[str, Any]] = None,
fetch_all: bool = False,
) -> pd.DataFrame:
"""
Convenience method to run "table.head" metric.
"""Convenience method to return the first several rows or records from a Batch of data.
(To be deprecated in favor of using methods in "MetricsCalculator" class.)
Args:
n_rows: The number of rows to return.
domain_kwargs: If provided, the domain for which to return records.
fetch_all: If True, ignore n_rows and return the entire batch.
Returns:
A Pandas DataFrame containing the records' data.
"""
if domain_kwargs is None:
domain_kwargs = {}
Expand Down
13 changes: 10 additions & 3 deletions great_expectations/validator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,15 @@ def compute_metrics(

@public_api
def columns(self, domain_kwargs: Optional[Dict[str, Any]] = None) -> List[str]:
"""
Convenience method to obtain Batch columns.
"""Convenience method to obtain Batch columns.
(To be deprecated in favor of using methods in "MetricsCalculator" class.)
Arguments:
domain_kwargs: Optional dictionary of domain kwargs (e.g., containing "batch_id").
Returns:
The list of Batch columns.
"""
return self._metrics_calculator.columns(domain_kwargs=domain_kwargs)

Expand All @@ -397,7 +402,9 @@ def head(
domain_kwargs: Optional[Dict[str, Any]] = None,
fetch_all: bool = False,
) -> pd.DataFrame:
"""Return the first several rows or records from a Batch of data.
"""Convenience method to return the first several rows or records from a Batch of data.
(To be deprecated in favor of using methods in "MetricsCalculator" class.)
Args:
n_rows: The number of rows to return.
Expand Down

0 comments on commit cf5d1bb

Please sign in to comment.