Skip to content

Commit

Permalink
0.15.1 release candidate v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Horkley committed Apr 14, 2022
2 parents c24784e + 073a03d commit 24179d9
Show file tree
Hide file tree
Showing 11 changed files with 694 additions and 120 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ title: Changelog
* [FEATURE] Add Support for Returning Parameters and Metrics as DataAssistantResult class (#4848)
* [FEATURE] DataAssistantResult Includes Underlying Profiler Execution Time (#4854)
* [FEATURE] Add batch_id for every resolved metric_value to ParameterBuilder.get_metrics() result object (#4860)
* [FEATURE] `RuntimeDataConnector` able to specify `Assets` (#4861)
* [BUGFIX] Linting error from hackathon automerge (#4829)
* [BUGFIX] Cleanup contrib (#4838)
* [BUGFIX] Add `notebook` to `GE_REQUIRED_DEPENDENCIES` (#4842)
* [BUGFIX] ParameterContainer return value formatting bug fix (#4840)
* [BUGFIX] Ensure that Parameter Validation/Configuration Dependency Configurations are included in Serialization (#4843)
* [BUGFIX] Correctly handle SQLA unexpected count metric for empty tables (#4618) (thanks @douglascook)
* [BUGFIX] Temporarily adjust Deprecation Warning Count (#4869)
* [DOCS] How to validate data with an in memory checkpoint (#4820)
* [DOCS] Update all tutorial redirect fix (#4841)
* [DOCS] redirect/remove dead links in docs (#4846)
Expand Down
2 changes: 2 additions & 0 deletions docs_rtd/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ Changelog
* [FEATURE] Add Support for Returning Parameters and Metrics as DataAssistantResult class (#4848)
* [FEATURE] DataAssistantResult Includes Underlying Profiler Execution Time (#4854)
* [FEATURE] Add batch_id for every resolved metric_value to ParameterBuilder.get_metrics() result object (#4860)
* [FEATURE] `RuntimeDataConnector` able to specify `Assets` (#4861)
* [BUGFIX] Linting error from hackathon automerge (#4829)
* [BUGFIX] Cleanup contrib (#4838)
* [BUGFIX] Add `notebook` to `GE_REQUIRED_DEPENDENCIES` (#4842)
* [BUGFIX] ParameterContainer return value formatting bug fix (#4840)
* [BUGFIX] Ensure that Parameter Validation/Configuration Dependency Configurations are included in Serialization (#4843)
* [BUGFIX] Correctly handle SQLA unexpected count metric for empty tables (#4618) (thanks @douglascook)
* [BUGFIX] Temporarily adjust Deprecation Warning Count (#4869)
* [DOCS] How to validate data with an in memory checkpoint (#4820)
* [DOCS] Update all tutorial redirect fix (#4841)
* [DOCS] redirect/remove dead links in docs (#4846)
Expand Down
7 changes: 7 additions & 0 deletions great_expectations/data_context/types/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def __init__(
max_keys=None,
schema_name=None,
batch_spec_passthrough=None,
batch_identifiers=None,
**kwargs,
):
if name is not None:
Expand All @@ -172,6 +173,8 @@ def __init__(
self.schema_name = schema_name
if batch_spec_passthrough is not None:
self.batch_spec_passthrough = batch_spec_passthrough
if batch_identifiers is not None:
self.batch_identifiers = batch_identifiers
for k, v in kwargs.items():
setattr(self, k, v)

Expand Down Expand Up @@ -216,6 +219,10 @@ class Meta:
table_name = fields.String(required=False, allow_none=True)
type = fields.String(required=False, allow_none=True)

batch_identifiers = fields.List(
cls_or_instance=fields.Str(), required=False, allow_none=True
)

@validates_schema
def validate_schema(self, data, **kwargs):
pass
Expand Down
6 changes: 6 additions & 0 deletions great_expectations/datasource/data_connector/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(
pattern: Optional[str] = None,
group_names: Optional[List[str]] = None,
batch_spec_passthrough: Optional[dict] = None,
batch_identifiers: Optional[List[str]] = None,
# S3
bucket: Optional[str] = None,
max_keys: Optional[int] = None,
Expand All @@ -39,6 +40,7 @@ def __init__(
# Note: this may need to become a nested object to accommodate sorters
self._group_names = group_names
self._batch_spec_passthrough = batch_spec_passthrough or {}
self._batch_identifiers = batch_identifiers

# S3
self._bucket = bucket
Expand Down Expand Up @@ -113,3 +115,7 @@ def prefix(self) -> Optional[str]:
@property
def delimiter(self) -> Optional[str]:
return self._delimiter

@property
def batch_identifiers(self) -> Optional[List[str]]:
return self._batch_identifiers
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from great_expectations.datasource.data_connector.file_path_data_connector import (
FilePathDataConnector,
)
from great_expectations.datasource.data_connector.util import _build_asset_from_config
from great_expectations.execution_engine import ExecutionEngine

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -80,28 +81,12 @@ def _build_assets_from_config(self, config: Dict[str, dict]):
if asset_config is None:
asset_config = {}
asset_config.update({"name": name})
new_asset: Asset = self._build_asset_from_config(
new_asset: Asset = _build_asset_from_config(
runtime_environment=self,
config=asset_config,
)
self.assets[name] = new_asset

def _build_asset_from_config(self, config: dict):
runtime_environment: dict = {"data_connector": self}
config = assetConfigSchema.load(config)
config = assetConfigSchema.dump(config)
asset: Asset = instantiate_class_from_config(
config=config,
runtime_environment=runtime_environment,
config_defaults={},
)
if not asset:
raise ge_exceptions.ClassInstantiationError(
module_name="great_expectations.datasource.data_connector.asset",
package_name=None,
class_name=config["class_name"],
)
return asset

def get_available_data_asset_names(self) -> List[str]:
"""
Return the list of asset names known by this DataConnector.
Expand Down

0 comments on commit 24179d9

Please sign in to comment.