Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is Great Expectations?

Data quality · Quality Foundations

What is Great Expectations?

Mediumquality-04
great expectationsexpectationsvalidationdata docs

Question

What is Great Expectations, and how do teams use it for data quality?

Solution

Great Expectations (GX) is an open-source data quality framework. You declare Expectations (rules about a batch of data), validate batches against them, and get human-readable reports called Data Docs.

Mental model

batch of data (table / file / query)
        |
        v
  Expectation Suite  (rules)
        |
        v
  Validation Result  (pass/fail + metrics)
        |
        v
  Data Docs / alerts / CI gate

Example expectations (conceptual)

  • expect_column_values_to_not_be_null on order_id
  • expect_column_values_to_be_unique on order_id
  • expect_column_values_to_be_between on amount (min=0)
  • expect_column_values_to_be_in_set on status
  • expect_table_row_count_to_be_between for volume sanity

Where it sits

  • After load, before publishing curated tables
  • In CI against sample fixtures
  • As a scheduled checkpoint on warehouse tables

vs dbt tests

dbt tests live next to SQL models and are warehouse-native. GX is richer for profiling, docs, and multi-source batches (files, Spark, DBs). Many stacks use both.

Interview tip: "GX = declarative expectations + validation + docs." Name 2-3 expectation types and say it gates bad data before consumers see it.

PreviousNext