great_expectations
¶
Subpackages¶
great_expectations.checkpoint
great_expectations.cli
great_expectations.cli.upgrade_helpers
great_expectations.cli.v012
great_expectations.cli.v012.upgrade_helpers
great_expectations.cli.v012.checkpoint
great_expectations.cli.v012.checkpoint_script_template
great_expectations.cli.v012.cli
great_expectations.cli.v012.cli_logging
great_expectations.cli.v012.cli_messages
great_expectations.cli.v012.datasource
great_expectations.cli.v012.docs
great_expectations.cli.v012.init
great_expectations.cli.v012.mark
great_expectations.cli.v012.project
great_expectations.cli.v012.python_subprocess
great_expectations.cli.v012.store
great_expectations.cli.v012.suite
great_expectations.cli.v012.toolkit
great_expectations.cli.v012.util
great_expectations.cli.v012.validation_operator
great_expectations.cli.batch_request
great_expectations.cli.build_docs
great_expectations.cli.checkpoint
great_expectations.cli.checkpoint_script_template
great_expectations.cli.cli
great_expectations.cli.cli_logging
great_expectations.cli.cli_messages
great_expectations.cli.datasource
great_expectations.cli.docs
great_expectations.cli.init
great_expectations.cli.mark
great_expectations.cli.pretty_printing
great_expectations.cli.project
great_expectations.cli.python_subprocess
great_expectations.cli.store
great_expectations.cli.suite
great_expectations.cli.toolkit
great_expectations.cli.util
great_expectations.cli.validation_operator
great_expectations.core
great_expectations.core.usage_statistics
great_expectations.core.batch
great_expectations.core.batch_spec
great_expectations.core.data_context_key
great_expectations.core.evaluation_parameters
great_expectations.core.expectation_configuration
great_expectations.core.expectation_suite
great_expectations.core.expectation_validation_result
great_expectations.core.id_dict
great_expectations.core.metric
great_expectations.core.run_identifier
great_expectations.core.urn
great_expectations.core.util
great_expectations.data_asset
great_expectations.data_context
great_expectations.data_context.store
great_expectations.data_context.store.checkpoint_store
great_expectations.data_context.store.configuration_store
great_expectations.data_context.store.database_store_backend
great_expectations.data_context.store.expectations_store
great_expectations.data_context.store.ge_cloud_store_backend
great_expectations.data_context.store.html_site_store
great_expectations.data_context.store.metric_store
great_expectations.data_context.store.query_store
great_expectations.data_context.store.store
great_expectations.data_context.store.store_backend
great_expectations.data_context.store.tuple_store_backend
great_expectations.data_context.store.util
great_expectations.data_context.store.validations_store
great_expectations.data_context.types
great_expectations.data_context.data_context
great_expectations.data_context.templates
great_expectations.data_context.util
great_expectations.dataset
great_expectations.datasource
great_expectations.datasource.batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.databricks_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.glob_reader_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.manual_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.query_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.s3_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.s3_subdir_reader_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.subdir_reader_batch_kwargs_generator
great_expectations.datasource.batch_kwargs_generator.table_batch_kwargs_generator
great_expectations.datasource.data_connector
great_expectations.datasource.data_connector.asset
great_expectations.datasource.data_connector.sorter
great_expectations.datasource.data_connector.batch_filter
great_expectations.datasource.data_connector.configured_asset_file_path_data_connector
great_expectations.datasource.data_connector.configured_asset_filesystem_data_connector
great_expectations.datasource.data_connector.configured_asset_s3_data_connector
great_expectations.datasource.data_connector.configured_asset_sql_data_connector
great_expectations.datasource.data_connector.data_connector
great_expectations.datasource.data_connector.file_path_data_connector
great_expectations.datasource.data_connector.inferred_asset_file_path_data_connector
great_expectations.datasource.data_connector.inferred_asset_filesystem_data_connector
great_expectations.datasource.data_connector.inferred_asset_s3_data_connector
great_expectations.datasource.data_connector.inferred_asset_sql_data_connector
great_expectations.datasource.data_connector.runtime_data_connector
great_expectations.datasource.data_connector.util
great_expectations.datasource.types
great_expectations.datasource.datasource
great_expectations.datasource.new_datasource
great_expectations.datasource.pandas_datasource
great_expectations.datasource.simple_sqlalchemy_datasource
great_expectations.datasource.sparkdf_datasource
great_expectations.datasource.sqlalchemy_datasource
great_expectations.exceptions
great_expectations.execution_engine
great_expectations.execution_engine.execution_engine
great_expectations.execution_engine.pandas_batch_data
great_expectations.execution_engine.pandas_execution_engine
great_expectations.execution_engine.sparkdf_batch_data
great_expectations.execution_engine.sparkdf_execution_engine
great_expectations.execution_engine.sqlalchemy_batch_data
great_expectations.execution_engine.sqlalchemy_execution_engine
great_expectations.execution_engine.util
great_expectations.expectations
great_expectations.expectations.core
great_expectations.expectations.core.expect_column_bootstrapped_ks_test_p_value_to_be_greater_than
great_expectations.expectations.core.expect_column_chisquare_test_p_value_to_be_greater_than
great_expectations.expectations.core.expect_column_distinct_values_to_be_in_set
great_expectations.expectations.core.expect_column_distinct_values_to_contain_set
great_expectations.expectations.core.expect_column_distinct_values_to_equal_set
great_expectations.expectations.core.expect_column_kl_divergence_to_be_less_than
great_expectations.expectations.core.expect_column_max_to_be_between
great_expectations.expectations.core.expect_column_mean_to_be_between
great_expectations.expectations.core.expect_column_median_to_be_between
great_expectations.expectations.core.expect_column_min_to_be_between
great_expectations.expectations.core.expect_column_most_common_value_to_be_in_set
great_expectations.expectations.core.expect_column_pair_cramers_phi_value_to_be_less_than
great_expectations.expectations.core.expect_column_pair_values_a_to_be_greater_than_b
great_expectations.expectations.core.expect_column_pair_values_to_be_equal
great_expectations.expectations.core.expect_column_pair_values_to_be_in_set
great_expectations.expectations.core.expect_column_parameterized_distribution_ks_test_p_value_to_be_greater_than
great_expectations.expectations.core.expect_column_proportion_of_unique_values_to_be_between
great_expectations.expectations.core.expect_column_quantile_values_to_be_between
great_expectations.expectations.core.expect_column_stdev_to_be_between
great_expectations.expectations.core.expect_column_sum_to_be_between
great_expectations.expectations.core.expect_column_to_exist
great_expectations.expectations.core.expect_column_unique_value_count_to_be_between
great_expectations.expectations.core.expect_column_value_lengths_to_be_between
great_expectations.expectations.core.expect_column_value_lengths_to_equal
great_expectations.expectations.core.expect_column_value_z_scores_to_be_less_than
great_expectations.expectations.core.expect_column_values_to_be_between
great_expectations.expectations.core.expect_column_values_to_be_dateutil_parseable
great_expectations.expectations.core.expect_column_values_to_be_decreasing
great_expectations.expectations.core.expect_column_values_to_be_in_set
great_expectations.expectations.core.expect_column_values_to_be_in_type_list
great_expectations.expectations.core.expect_column_values_to_be_increasing
great_expectations.expectations.core.expect_column_values_to_be_json_parseable
great_expectations.expectations.core.expect_column_values_to_be_null
great_expectations.expectations.core.expect_column_values_to_be_of_type
great_expectations.expectations.core.expect_column_values_to_be_unique
great_expectations.expectations.core.expect_column_values_to_match_json_schema
great_expectations.expectations.core.expect_column_values_to_match_like_pattern
great_expectations.expectations.core.expect_column_values_to_match_like_pattern_list
great_expectations.expectations.core.expect_column_values_to_match_regex
great_expectations.expectations.core.expect_column_values_to_match_regex_list
great_expectations.expectations.core.expect_column_values_to_match_strftime_format
great_expectations.expectations.core.expect_column_values_to_not_be_in_set
great_expectations.expectations.core.expect_column_values_to_not_be_null
great_expectations.expectations.core.expect_column_values_to_not_match_like_pattern
great_expectations.expectations.core.expect_column_values_to_not_match_like_pattern_list
great_expectations.expectations.core.expect_column_values_to_not_match_regex
great_expectations.expectations.core.expect_column_values_to_not_match_regex_list
great_expectations.expectations.core.expect_compound_columns_to_be_unique
great_expectations.expectations.core.expect_multicolumn_sum_to_equal
great_expectations.expectations.core.expect_multicolumn_values_to_be_unique
great_expectations.expectations.core.expect_select_column_values_to_be_unique_within_record
great_expectations.expectations.core.expect_table_column_count_to_be_between
great_expectations.expectations.core.expect_table_column_count_to_equal
great_expectations.expectations.core.expect_table_columns_to_match_ordered_list
great_expectations.expectations.core.expect_table_columns_to_match_set
great_expectations.expectations.core.expect_table_row_count_to_be_between
great_expectations.expectations.core.expect_table_row_count_to_equal
great_expectations.expectations.core.expect_table_row_count_to_equal_other_table
great_expectations.expectations.metrics
great_expectations.expectations.metrics.column_aggregate_metrics
great_expectations.expectations.metrics.column_map_metrics
great_expectations.expectations.metrics.column_pair_map_metrics
great_expectations.expectations.metrics.multicolumn_map_metrics
great_expectations.expectations.metrics.table_metrics
great_expectations.expectations.metrics.column_aggregate_metric
great_expectations.expectations.metrics.column_aggregate_metric_provider
great_expectations.expectations.metrics.import_manager
great_expectations.expectations.metrics.map_metric
great_expectations.expectations.metrics.map_metric_provider
great_expectations.expectations.metrics.meta_metric_provider
great_expectations.expectations.metrics.metric_provider
great_expectations.expectations.metrics.table_metric
great_expectations.expectations.metrics.table_metric_provider
great_expectations.expectations.metrics.util
great_expectations.expectations.expectation
great_expectations.expectations.registry
great_expectations.expectations.row_conditions
great_expectations.expectations.util
great_expectations.expectations.validation_handlers
great_expectations.jupyter_ux
great_expectations.marshmallow__shade
great_expectations.marshmallow__shade.base
great_expectations.marshmallow__shade.class_registry
great_expectations.marshmallow__shade.decorators
great_expectations.marshmallow__shade.error_store
great_expectations.marshmallow__shade.exceptions
great_expectations.marshmallow__shade.fields
great_expectations.marshmallow__shade.orderedset
great_expectations.marshmallow__shade.schema
great_expectations.marshmallow__shade.types
great_expectations.marshmallow__shade.utils
great_expectations.marshmallow__shade.validate
great_expectations.marshmallow__shade.warnings
great_expectations.profile
great_expectations.profile.base
great_expectations.profile.basic_dataset_profiler
great_expectations.profile.basic_suite_builder_profiler
great_expectations.profile.columns_exist
great_expectations.profile.json_schema_profiler
great_expectations.profile.metrics_utils
great_expectations.profile.multi_batch_validation_meta_analysis
great_expectations.profile.user_configurable_profiler
great_expectations.render
great_expectations.render.notebook_assets
great_expectations.render.renderer
great_expectations.render.renderer.content_block
great_expectations.render.renderer.call_to_action_renderer
great_expectations.render.renderer.checkpoint_new_notebook_renderer
great_expectations.render.renderer.column_section_renderer
great_expectations.render.renderer.datasource_new_notebook_renderer
great_expectations.render.renderer.email_renderer
great_expectations.render.renderer.microsoft_teams_renderer
great_expectations.render.renderer.notebook_renderer
great_expectations.render.renderer.opsgenie_renderer
great_expectations.render.renderer.page_renderer
great_expectations.render.renderer.profiling_results_overview_section_renderer
great_expectations.render.renderer.renderer
great_expectations.render.renderer.site_builder
great_expectations.render.renderer.site_index_page_renderer
great_expectations.render.renderer.slack_renderer
great_expectations.render.renderer.suite_edit_notebook_renderer
great_expectations.render.renderer.suite_scaffold_notebook_renderer
great_expectations.render.types
great_expectations.render.v3
great_expectations.render.view
great_expectations.render.exceptions
great_expectations.render.page_renderer_util
great_expectations.render.util
great_expectations.rule_based_profiler
great_expectations.rule_based_profiler.domain_builder
great_expectations.rule_based_profiler.domain_builder.types
great_expectations.rule_based_profiler.domain_builder.column_domain_builder
great_expectations.rule_based_profiler.domain_builder.domain_builder
great_expectations.rule_based_profiler.domain_builder.simple_column_suffix_domain_builder
great_expectations.rule_based_profiler.domain_builder.simple_semantic_type_domain_builder
great_expectations.rule_based_profiler.domain_builder.table_domain_builder
great_expectations.rule_based_profiler.expectation_configuration_builder
great_expectations.rule_based_profiler.parameter_builder
great_expectations.rule_based_profiler.parameter_builder.metric_parameter_builder
great_expectations.rule_based_profiler.parameter_builder.numeric_metric_range_multi_batch_parameter_builder
great_expectations.rule_based_profiler.parameter_builder.parameter_builder
great_expectations.rule_based_profiler.parameter_builder.parameter_container
great_expectations.rule_based_profiler.rule
great_expectations.rule_based_profiler.profiler
great_expectations.rule_based_profiler.util
great_expectations.self_check
great_expectations.types
great_expectations.validation_operators
great_expectations.validator
Package Contents¶
Classes¶
|
A DataContext represents a Great Expectations project. It organizes storage and access for |
Functions¶
Get version information or return default if unable to do so. |
-
great_expectations.
get_versions
()¶ Get version information or return default if unable to do so.
-
great_expectations.
__version__
¶
-
class
great_expectations.
DataContext
(context_root_dir=None, runtime_environment=None)¶ Bases:
great_expectations.data_context.data_context.BaseDataContext
A DataContext represents a Great Expectations project. It organizes storage and access for expectation suites, datasources, notification settings, and data fixtures.
The DataContext is configured via a yml file stored in a directory called great_expectations; the configuration file as well as managed expectation suites should be stored in version control.
Use the create classmethod to create a new empty config, or instantiate the DataContext by passing the path to an existing data context root directory.
DataContexts use data sources you’re already familiar with. BatchKwargGenerators help introspect data stores and data execution frameworks (such as airflow, Nifi, dbt, or dagster) to describe and produce batches of data ready for analysis. This enables fetching, validation, profiling, and documentation of your data in a way that is meaningful within your existing infrastructure and work environment.
DataContexts use a datasource-based namespace, where each accessible type of data has a three-part normalized data_asset_name, consisting of datasource/generator/data_asset_name.
The datasource actually connects to a source of materialized data and returns Great Expectations DataAssets connected to a compute environment and ready for validation.
The BatchKwargGenerator knows how to introspect datasources and produce identifying “batch_kwargs” that define particular slices of data.
The data_asset_name is a specific name – often a table name or other name familiar to users – that batch kwargs generators can slice into batches.
An expectation suite is a collection of expectations ready to be applied to a batch of data. Since in many projects it is useful to have different expectations evaluate in different contexts–profiling vs. testing; warning vs. error; high vs. low compute; ML model or dashboard–suites provide a namespace option for selecting which expectations a DataContext returns.
In many simple projects, the datasource or batch kwargs generator name may be omitted and the DataContext will infer the correct name when there is no ambiguity.
Similarly, if no expectation suite name is provided, the DataContext will assume the name “default”.
-
classmethod
create
(cls, project_root_dir=None, usage_statistics_enabled=True, runtime_environment=None)¶ Build a new great_expectations directory and DataContext object in the provided project_root_dir.
create will not create a new “great_expectations” directory in the provided folder, provided one does not already exist. Then, it will initialize a new DataContext in that folder and write the resulting config.
- Parameters
project_root_dir – path to the root directory in which to create a new great_expectations directory
runtime_environment – a dictionary of config variables that
both those set in config_variables.yml and the environment (override) –
- Returns
DataContext
-
classmethod
all_uncommitted_directories_exist
(cls, ge_dir)¶ Check if all uncommitted directories exist.
-
classmethod
config_variables_yml_exist
(cls, ge_dir)¶ Check if all config_variables.yml exists.
-
classmethod
write_config_variables_template_to_disk
(cls, uncommitted_dir)¶
-
classmethod
write_project_template_to_disk
(cls, ge_dir, usage_statistics_enabled=True)¶
-
classmethod
scaffold_directories
(cls, base_dir)¶ Safely create GE directories for a new project.
-
classmethod
scaffold_custom_data_docs
(cls, plugins_dir)¶ Copy custom data docs templates
-
classmethod
scaffold_notebooks
(cls, base_dir)¶ Copy template notebooks into the notebooks directory for a project.
-
_load_project_config
(self)¶ Reads the project configuration from the project configuration file. The file may contain ${SOME_VARIABLE} variables - see self.project_config_with_variables_substituted for how these are substituted.
- Returns
the configuration object read from the file
-
_save_project_config
(self)¶ Save the current project to disk.
-
add_store
(self, store_name, store_config)¶ Add a new Store to the DataContext and (for convenience) return the instantiated Store object.
- Parameters
store_name (str) – a key for the new Store in in self._stores
store_config (dict) – a config for the Store to add
- Returns
store (Store)
-
add_datasource
(self, name, **kwargs)¶ Add a new datasource to the data context, with configuration provided as kwargs. :param name: the name for the new datasource to add :param initialize: if False, add the datasource to the config, but do not
initialize it, for example if a user needs to debug database connectivity.
- Parameters
kwargs (keyword arguments) – the configuration for the new datasource
- Returns
datasource (Datasource)
-
delete_datasource
(self, name: str)¶ Delete a data source :param datasource_name: The name of the datasource to delete.
- Raises
ValueError – If the datasource name isn’t provided or cannot be found.
-
classmethod
find_context_root_dir
(cls)¶
-
classmethod
get_ge_config_version
(cls, context_root_dir=None)¶
-
classmethod
set_ge_config_version
(cls, config_version, context_root_dir=None, validate_config_version=True)¶
-
classmethod
find_context_yml_file
(cls, search_start_dir=None)¶ Search for the yml file starting here and moving upward.
-
classmethod
does_config_exist_on_disk
(cls, context_root_dir)¶ Return True if the great_expectations.yml exists on disk.
-
classmethod
is_project_initialized
(cls, ge_dir)¶ Return True if the project is initialized.
To be considered initialized, all of the following must be true: - all project directories exist (including uncommitted directories) - a valid great_expectations.yml is on disk - a config_variables.yml is on disk - the project has at least one datasource - the project has at least one suite
-
classmethod
does_project_have_a_datasource_in_config_file
(cls, ge_dir)¶
-
classmethod
_does_context_have_at_least_one_datasource
(cls, ge_dir)¶
-
classmethod
_does_context_have_at_least_one_suite
(cls, ge_dir)¶
-
classmethod
_attempt_context_instantiation
(cls, ge_dir)¶
-
great_expectations.
rtd_url_ge_version
¶