{"id":14403,"library":"acryl-great-expectations","title":"Acryl Great Expectations","description":"Acryl Great Expectations is Acryl Data's opinionated flavor of the Great Expectations data validation library, providing a specific set of configurations and integrations primarily for use with the DataHub metadata platform. It currently pins to an older, V2 configuration API of Great Expectations (versions `<0.16.0`). Its release cadence is tied to DataHub releases.","status":"active","version":"0.15.50.1","language":"en","source_language":"en","source_url":"https://github.com/datahub-project/datahub","tags":["data quality","data validation","great expectations","datahub","acryl data","etl"],"install":[{"cmd":"pip install acryl-great-expectations","lang":"bash","label":"Install core package"}],"dependencies":[{"reason":"Provides core data validation functionality; acryl-great-expectations pins it to versions <0.16.0, mandating the use of the V2 API.","package":"great-expectations","optional":false}],"imports":[{"note":"Commonly used for in-memory data validation with Pandas DataFrames in V2 API.","symbol":"PandasDataset","correct":"from great_expectations.dataset import PandasDataset"},{"note":"For programmatic creation and management of expectation suites in V2 API.","symbol":"ExpectationSuite","correct":"from great_expectations.core.expectation_suite import ExpectationSuite"},{"note":"While the explicit path works, the top-level import is more common. Avoid V3 `DataContext.get_context()` calls.","wrong":"from great_expectations.data_context.data_context import DataContext","symbol":"DataContext","correct":"from great_expectations.data_context import DataContext"}],"quickstart":{"code":"import pandas as pd\nfrom great_expectations.dataset import PandasDataset\nfrom great_expectations.core.batch_spec import BatchSpec\n\n# Sample data\ndf = pd.DataFrame({\n    \"id\": [1, 2, 3, 4, 5],\n    \"value\": [10, 20, 30, 40, 50],\n    \"category\": [\"A\", \"B\", \"A\", \"C\", \"B\"]\n})\n\n# Create a PandasDataset (V2 API style for in-memory validation)\nbatch = PandasDataset(df, batch_spec=BatchSpec(data_asset_name=\"my_dataframe\"))\n\n# Define and add expectations\nbatch.expect_column_to_exist(\"id\")\nbatch.expect_column_values_to_be_between(\"value\", min_value=0, max_value=100)\nbatch.expect_column_distinct_values_to_be_in_set(\"category\", [\"A\", \"B\", \"C\"])\n\n# Validate the batch\nvalidation_result = batch.validate()\n\nprint(f\"Validation successful: {validation_result.success}\")\nif not validation_result.success:\n    print(\"Validation failed details:\")\n    for result in validation_result.results:\n        if not result.success:\n            print(f\"  Expectation: {result.expectation_config.expectation_type}, Status: {result.success}\")\n\n# Expected output: Validation successful: True","lang":"python","description":"This quickstart demonstrates basic data validation using Great Expectations' V2 API, which `acryl-great-expectations` provides. It uses an in-memory Pandas DataFrame to create a `PandasDataset`, adds a few common expectations, and runs a validation."},"warnings":[{"fix":"Ensure all Great Expectations code and configuration used with `acryl-great-expectations` adheres to the V2 API patterns. Do not attempt to use V3-specific classes, methods, or configuration formats (e.g., `DataContext.get_context()` or V3 YML schema).","message":"`acryl-great-expectations` explicitly pins its `great-expectations` dependency to versions `<0.16.0`. This means it *only* supports the legacy V2 API of Great Expectations, which is fundamentally incompatible with the V3 API introduced in `great-expectations>=0.17.0`.","severity":"breaking","affected_versions":"0.15.50.1 (and all other versions of acryl-great-expectations)"},{"fix":"Always refer to V2 API documentation for `great_expectations.yml` structure and best practices when working with `acryl-great-expectations`.","message":"Configuration files (e.g., `great_expectations.yml`) generated or modified for the V3 Great Expectations API will cause parsing errors or unexpected behavior when used with `acryl-great-expectations` due to its V2 API dependency. The structure and available parameters differ significantly.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If not explicitly integrating with DataHub, consider using the main `pip install great-expectations` package to access the latest features and documentation (V3 API).","message":"The primary intent of `acryl-great-expectations` is to provide Great Expectations functionality specifically for DataHub integrations. While it can be used standalone, users new to Great Expectations might find clearer guidance and more up-to-date examples using the main `great-expectations` library (which supports V3 API).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Use `from great_expectations.data_context import DataContext` (V2 common import) or confirm V2-compatible paths.","cause":"Attempting to import `DataContext` from a V3-specific path, which might not be directly available or work as expected with the V2 API.","error":"ModuleNotFoundError: No module named 'great_expectations.data_context.data_context'"},{"fix":"Instantiate the `DataContext` directly via its constructor (e.g., `DataContext('/path/to/project')`) as per V2 API documentation.","cause":"Attempting to use the V3 API method `DataContext.get_context()` with a DataContext instance from the V2 API, which lacks this method.","error":"AttributeError: 'DataContext' object has no attribute 'get_context'"},{"fix":"Revert to a `great_expectations.yml` configuration adhering to the V2 API schema, or manually adjust the file to remove V3-specific elements like `fluent_datasources`.","cause":"Using a `great_expectations.yml` file formatted for the V3 API with `acryl-great-expectations`, which expects the V2 configuration schema.","error":"great_expectations.exceptions.exceptions.InvalidConfigurationBundleError: The great_expectations.yml file in /path/to/great_expectations is not valid. The following errors were found:\n  - ... (schema validation errors related to V3 fields)"}],"ecosystem":"pypi"}