Skip to main content

Great Expectations Cloud

Project description

cloud

PyPI Docker Pulls ci pre-commit.ci status codecov Ruff

Quick Start

Python

Install

pip install great_expectations_cloud
Optional Dependencies
pip install 'great_expectations_cloud[sql]'
$ gx-agent --help
usage: gx-agent [-h] [--log-level LOG_LEVEL] [--skip-log-file SKIP_LOG_FILE] [--log-cfg-file LOG_CFG_FILE] [--version]

optional arguments:
  -h, --help            show this help message and exit
  --log-level LOG_LEVEL
                        Level of logging to use. Defaults to WARNING.
  --skip-log-file SKIP_LOG_FILE
                        Skip writing debug logs to a file. Defaults to False. Does not affect logging to stdout/stderr.
  --log-cfg-file LOG_CFG_FILE
                        Path to a logging configuration json file. Supersedes --log-level and --skip-log-file.
  --version             Show the gx agent version.

Set env variables

GX_CLOUD_ACCESS_TOKEN GX_CLOUD_ORGANIZATION_ID

Start the Agent

If you intend to run the agent against local services (Cloud backend or datasources) run the agent outside of the container.

gx-agent

Docker

Building and running the Agent with Docker

Dev Setup

See also CONTRIBUTING.md

  1. Install poetry
  2. Set up virtual environment and install dependencies.
    • poetry install --sync
  3. Activate your virtual environment.
    • poetry shell
  4. Set up precommit hooks
    • pre-commit install

Developer Tasks

Common developer tasks are available via invoke (defined in tasks.py)

invoke --list to see available tasks.

Synchronize Dependencies

To ensure you are using the latest version of the core and development dependencies run poetry install --sync. Also available as an invoke task.

invoke deps

Updating poetry.lock dependencies

The dependencies installed in our CI and the docker build step are determined by the poetry.lock file.

To update only a specific dependency (such as great_expectations) ...

poetry update great_expectations

To resolve and update all dependencies ...

poetry lock

In either case, the updated poetry.lock file must be committed and merged to main.

Building and Running the GX Agent Image

To build the GX Agent Docker image, run the following in the root dir:

invoke docker

Running the GX Agent:

invoke docker --run

or

docker run --env GX_CLOUD_ACCESS_TOKEN="<GX_TOKEN>" --env GX_CLOUD_ORGANIZATION_ID="<GX_ORG_ID>" gx/agent

Now go into GX Cloud and issue commands for the GX Agent to run, such as generating an Expectation Suite for a Data Source.

Note if you are pushing out a new image update the image tag version in containerize-agent.yaml. The image will be built and pushed out via GitHub Actions.

Example Data

The contents from /examples/agent/data will be copied to /data for the docker container.

Adding an action to the agent

  1. Make a new action in great_expectations_cloud/agent/actions/ in a separate file.
  2. Register your action in the file it was created in using great_expectations_cloud.agent.event_handler.register_event_action(). Register for the major version of GX Core that the action applies to, e.g. register_event_action("1", RunCheckpointEvent, RunCheckpointAction) registers the action for major version 1 of GX Core (e.g. 1.0.0).
  3. Import your action in great_expectations_cloud/agent/actions/__init__.py

Note: The agent is core-version specific but this registration mechanism allows us to preemptively work on actions for future versions of GX Core while still supporting the existing latest major version.

Release Process

Versioning

This is the version that will be used for the docker image tag as well.

Standard Release: The versioning scheme is YYYYMMDD.{release_number} where:

  • the date is the date of the release
  • the release number starts at 0 for the first release of the day
  • the release number is incremented for each release within the same day

For example: 20240403.0

Pre-release: The versioing scheme is YYYYMMDD.{release_number}.dev{dev_number}

  • the date is the date of the release
  • the dev number starts at 0 for the first pre-release of the day
  • the dev number is incremented for each pre-release within the same day
  • the release number is the release that this pre-release is for

For example: 20240403.0.dev0 is the first pre-release for the 20240403.0 release.

For example, imagine the following sequence of releases given for a day with two releases:

  • 20240403.0.dev0
  • 20240403.0.dev1
  • 20240403.0
  • 20240403.1.dev0
  • 20240403.1

There can be days with no standard releases, only pre-releases or days with no pre-release or standard release at all.

Pre-releases

Pre-releases are completed automatically with each merge to the main branch. The version is updated in pyproject.toml and a pre-release is created on PyPi. A new docker tag will also be generated and pushed to Docker Hub

Manual Pre-releases

NOTE: CI will automatically create pre-releases on merges to main. Instead of manually creating pre-releases, consider using the CI process. This is only for exceptional cases.

To manually create a pre-release, run the following command to update the version in pyproject.toml and then merge it to main in a standalone PR:

invoke pre-release

This will create a new pre-release version. On the next merge to main, the release will be uploaded to PyPi. A new docker tag will also be generated and pushed to Docker Hub

Releases

Releases will be completed on a regular basis by the maintainers of the project and with any release of GX Core

For maintainers, to create a release, run the following command to update the version in pyproject.toml and then merge it to main in a standalone PR:

invoke release

This will create a new release version. On the next merge to main, the release will be uploaded to PyPi. A new docker tag will also be generated and pushed to Docker Hub

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

great_expectations_cloud-20240417.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file great_expectations_cloud-20240417.0.tar.gz.

File metadata

File hashes

Hashes for great_expectations_cloud-20240417.0.tar.gz
Algorithm Hash digest
SHA256 e4b0a6a22a6520ebd73b057fd6f1728bd24ec76bdc2086e377d9aa679ac7d1c5
MD5 2296faa5c41ea1b7eab7fc6aa8b68af1
BLAKE2b-256 2a0b309b2fc017e67e5cfdf2e2091e724f5ff8f8bbecf9610364d80f1f5f8cd6

See more details on using hashes here.

File details

Details for the file great_expectations_cloud-20240417.0-py3-none-any.whl.

File metadata

File hashes

Hashes for great_expectations_cloud-20240417.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bf3490a8fb8cf6e2f0982db7134e24b86dc9ca40cbd876c87f7b5c0a02e0415
MD5 33f1296d8546df058264bdceade234f4
BLAKE2b-256 ca025cb2a72a7140bed4b4db23635c8318dee6fa28b5f9269de9d05655b3f7db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page