Skip to main content
Version: 1.3.7

CloudDataContext

Signature

class great_expectations.data_context.CloudDataContext(project_config: Optional[Union[DataContextConfig, Mapping]] = None, context_root_dir: Optional[PathStr] = None, project_root_dir: Optional[PathStr] = None, runtime_environment: Optional[dict] = None, cloud_base_url: Optional[str] = None, cloud_access_token: Optional[str] = None, cloud_organization_id: Optional[str] = None, user_agent_str: Optional[str] = None)

Subclass of AbstractDataContext that contains functionality necessary to work in a GX Cloud-backed environment.

Properties

NameDescriptionReference

checkpoints

Responsible for basic CRUD operations on a context's Checkpoints.

CheckpointFactory

data_sources

Responsible for basic CRUD operations on a context's DataSources.

DataSourceManager

suites

Responsible for basic CRUD operations on a context's ExpectationSuites.

SuiteFactory

validation_definitions

Responsible for basic CRUD operations on a context's ValidationDefinitions.

ValidationDefinitionFactory

Methods

Signature

classmethod _create(project_root_dir: Optional[PathStr] = None, runtime_environment: Optional[dict] = None) → SerializableDataContext

Build a new great_expectations directory and DataContext object in the provided project_root_dir.

create will 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.

Relevant Documentation Links

Data Context

Parameters

NameDescription

project_root_dir

path to the root directory in which to create a new great_expectations directory

Returns

TypeDescription

SerializableDataContext

DataContext

Signature

add_data_docs_site(site_name: str, site_config: DataDocsSiteConfigTypedDict)None

Add a new Data Docs Site to the DataContext.

New in version 0.17.2.

Example site config dicts can be found in our "Host and share Data Docs" guides.

Parameters

NameDescription

site_name

New site name to add.

Signature

build_data_docs(site_names: list[str] | None = None, resource_identifiers: list[great_expectations.data_context.types.resource_identifiers.ExpectationSuiteIdentifier] | list[great_expectations.data_context.types.resource_identifiers.ValidationResultIdentifier] | None = None, dry_run: bool = False, build_index: bool = True)dict[str, str]

Build Data Docs for your project.

Relevant Documentation Links

Parameters

NameDescription

site_names

if specified, build data docs only for these sites, otherwise, build all the sites specified in the context's config

Returns

TypeDescription

dict[str, str]

A dictionary with the names of the updated data documentation sites as keys and the location info of their index.html files as values

Raises

TypeDescription

ClassInstantiationError

Site config in your Data Context config is not valid.

Signature

delete_data_docs_site(site_name: str)

Delete an existing Data Docs Site.

New in version 0.17.2.

Parameters

NameDescription

site_name

Site name to delete.

Signature

enable_analytics(enable: Optional[bool])None

Enable or disable analytics for this DataContext. With non-ephemeral contexts, this can be preserved via context.variables.save().

If set to None, the GX_ANALYTICS_ENABLED environment variable will be used.

Signature

list_data_docs_sites()dict[str, DataDocsSiteConfigTypedDict]

List all Data Docs Sites with configurations.

New in version 0.17.2.

Signature

update_data_docs_site(site_name: str, site_config: DataDocsSiteConfigTypedDict)None

Update an existing Data Docs Site.

New in version 0.17.2.

Example site config dicts can be found in our "Host and share Data Docs" guides.

Parameters

NameDescription

site_name

Site name to update.

Signature

update_project_config(project_config: Union[great_expectations.data_context.types.base.DataContextConfig, Mapping]) → great_expectations.data_context.types.base.DataContextConfig

Update the context's config with the values from another config object.

Parameters

NameDescription

project_config

The config to use to update the context's internal state.

Returns

TypeDescription

great_expectations.data_context.types.base.DataContextConfig

The updated project config.

Signature

view_validation_result(result: CheckpointResult)None

New in version 0.16.15.

Opens a validation result in a browser.

Parameters

NameDescription

result

The result of a Checkpoint run.